FreeBASIC
0.91.0
|
#include "fb.bi"
#include "fbint.bi"
#include "ir.bi"
#include "rtl.bi"
#include "flist.bi"
#include "lex.bi"
Go to the source code of this file.
Data Structures | |
class | IRCALLARG |
class | IRHLCCTX |
Enumerations | |
enum | { SECTION_HEAD, SECTION_BODY, SECTION_FOOT } |
Functions | |
function_as_string | hEmitType (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_integer is_result=FALSE) |
sub | hEmitStruct (byval_as_FBSYMBOL_ptr s) |
sub | _emitDBG (byval_as_integer op, byval_as_FBSYMBOL_ptr proc, byval_as_integer ex) |
function_as_string | hVregToStr (byval_as_IRVREG_ptr vreg) |
sub | _emitConvert (byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr v2) |
sub | _emitStore (byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr v2) |
sub | _emitBop (byval_as_integer op, byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr v2, byval_as_IRVREG_ptr vr, byval_as_FBSYMBOL_ptr ex) |
private sub | _init () |
private sub | _end () |
private sub | hWriteLine (byref_as_string ln) |
private sub | hWriteLabel (byval_as_zstring_ptr id) |
private function_as_string | hEmitParamName (byval_as_FBSYMBOL_ptr sym) |
private function_as_string | hEmitProcCallConv (byval_as_FBSYMBOL_ptr proc) |
private function_as_string | hEmitProcHeader (byval_as_FBSYMBOL_ptr proc, byval_as_integer is_proto) |
private function_as_string | hGetUDTName (byval_as_FBSYMBOL_ptr sym) |
private sub | hEmitUDT (byval_as_FBSYMBOL_ptr s) |
private function_as_string | hEmitArrayDecl (byval_as_FBSYMBOL_ptr sym) |
private sub | hBuildStrLit (byref_as_string ln, byval_as_integer wantedlength, byval_as_zstring_ptr z, byval_as_integer length) |
private sub | hBuildWstrLit (byref_as_string ln, byval_as_integer wantedlength, byval_as_wstring_ptr w, byval_as_integer length) |
private function_as_string | hEmitStrLitType (byval_as_integer length) |
private function_as_string | hEmitSymType (byval_as_FBSYMBOL_ptr sym) |
private sub | hEmitVariable (byval_as_FBSYMBOL_ptr sym) |
private sub | hEmitFuncProto (byval_as_FBSYMBOL_ptr s) |
private sub | hEmitDecls (byval_as_FBSYMBOL_ptr s, byval_as_integer procs=FALSE) |
private sub | hEmitDataStmt () |
private sub | hEmitForwardDecls () |
private sub | hWriteFTOI (byref_as_string fname, byval_as_integer rtype, byval_as_integer ptype) |
private sub | hEmitFTOIBuiltins () |
private function_as_integer | _emitBegin () |
private sub | _emitEnd (byval_as_double tottime) |
private function_as_integer | _getOptionValue (byval_as_IR_OPTIONVALUE opt) |
private sub | _procBegin (byval_as_FBSYMBOL_ptr proc) |
private sub | _procEnd (byval_as_FBSYMBOL_ptr proc) |
private sub | _procAllocArg (byval_as_FBSYMBOL_ptr proc, byval_as_FBSYMBOL_ptr sym) |
private sub | _procAllocLocal (byval_as_FBSYMBOL_ptr proc, byval_as_FBSYMBOL_ptr sym) |
private sub | _scopeBegin (byval_as_FBSYMBOL_ptr s) |
private sub | _scopeEnd (byval_as_FBSYMBOL_ptr s) |
private sub | _procAllocStaticVars (byval_as_FBSYMBOL_ptr head_sym) |
private function_as_IRVREG_ptr | hNewVR (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_integer vtype) |
private function_as_IRVREG_ptr | _allocVreg (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype) |
private function_as_IRVREG_ptr | _allocVrImm (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_longint value) |
private function_as_IRVREG_ptr | _allocVrImmF (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_double value) |
private function_as_IRVREG_ptr | _allocVrVar (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_FBSYMBOL_ptr symbol, byval_as_longint ofs) |
private function_as_IRVREG_ptr | _allocVrIdx (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_FBSYMBOL_ptr symbol, byval_as_longint ofs, byval_as_integer mult, byval_as_IRVREG_ptr vidx) |
private function_as_IRVREG_ptr | _allocVrPtr (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_longint ofs, byval_as_IRVREG_ptr vidx) |
private function_as_IRVREG_ptr | _allocVrOfs (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_FBSYMBOL_ptr symbol, byval_as_longint ofs) |
private sub | _setVregDataType (byval_as_IRVREG_ptr v, byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype) |
private sub | hPrepareAddress (byval_as_IRVREG_ptr v) |
private sub | hLoadVreg (byval_as_IRVREG_ptr v) |
private function_as_string | hEmitInt (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype, byval_as_integer value) |
private function_as_string | hEmitLong (byval_as_longint value) |
private function_as_string | hEmitFloat (byval_as_double value) |
private sub | _emitLabel (byval_as_FBSYMBOL_ptr label) |
private function_as_zstring_ptr | hGetBopCode (byval_as_integer op, byval_as_integer dtype) |
private sub | _emitUop (byval_as_integer op, byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr vr) |
private sub | _emitSpillRegs () |
private sub | _emitLoad (byval_as_IRVREG_ptr v1) |
private sub | _emitLoadRes (byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr vr) |
private sub | _emitPushArg (byval_as_FBSYMBOL_ptr param, byval_as_IRVREG_ptr vr, byval_as_longint udtlen, byval_as_integer level) |
private sub | _emitAddr (byval_as_integer op, byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr vr) |
private sub | hDoCall (byval_as_zstring_ptr pname, byval_as_FBSYMBOL_ptr proc, byval_as_integer bytestopop, byval_as_IRVREG_ptr vr, byval_as_integer level) |
private sub | _emitCall (byval_as_FBSYMBOL_ptr proc, byval_as_integer bytestopop, byval_as_IRVREG_ptr vr, byval_as_integer level) |
private sub | _emitCallPtr (byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr vr, byval_as_integer bytestopop, byval_as_integer level) |
private sub | _emitJumpPtr (byval_as_IRVREG_ptr v1) |
private sub | _emitBranch (byval_as_integer op, byval_as_FBSYMBOL_ptr label) |
private sub | _emitJmpTb (byval_as_IRVREG_ptr v1, byval_as_FBSYMBOL_ptr tbsym, byval_as_ulongint_ptr values, byval_as_FBSYMBOL_ptr_ptr labels, byval_as_integer labelcount, byval_as_FBSYMBOL_ptr deflabel, byval_as_ulongint minval, byval_as_ulongint maxval) |
private sub | _emitMem (byval_as_integer op, byval_as_IRVREG_ptr v1, byval_as_IRVREG_ptr v2, byval_as_longint bytes) |
private sub | _emitDECL (byval_as_FBSYMBOL_ptr sym) |
private sub | _emitComment (byval_as_zstring_ptr text) |
private sub | _emitAsmBegin () |
private sub | _emitAsmText (byval_as_zstring_ptr text) |
private sub | _emitAsmSymb (byval_as_FBSYMBOL_ptr sym) |
private sub | _emitAsmEnd () |
private sub | _emitVarIniBegin (byval_as_FBSYMBOL_ptr sym) |
private sub | _emitVarIniEnd (byval_as_FBSYMBOL_ptr sym) |
private sub | hVarIniElementType (byval_as_integer dtype, byval_as_FBSYMBOL_ptr subtype) |
private sub | hVarIniSeparator () |
private sub | _emitVarIniI (byval_as_FBSYMBOL_ptr sym, byval_as_longint value) |
private sub | _emitVarIniF (byval_as_FBSYMBOL_ptr sym, byval_as_double value) |
private sub | _emitVarIniOfs (byval_as_FBSYMBOL_ptr sym, byval_as_longint ofs) |
private sub | _emitVarIniStr (byval_as_longint varlength, byval_as_zstring_ptr literal, byval_as_longint litlength) |
private sub | _emitVarIniWstr (byval_as_longint varlength, byval_as_wstring_ptr literal, byval_as_longint litlength) |
private sub | _emitVarIniPad (byval_as_longint bytes) |
private sub | _emitVarIniScopeBegin () |
private sub | _emitVarIniScopeEnd () |
private sub | _emitFbctinfBegin () |
private sub | _emitFbctinfString (byval_as_zstring_ptr s) |
private sub | _emitFbctinfEnd () |
private sub | _emitProcBegin (byval_as_FBSYMBOL_ptr proc, byval_as_FBSYMBOL_ptr initlabel) |
private sub | _emitProcEnd (byval_as_FBSYMBOL_ptr proc, byval_as_FBSYMBOL_ptr initlabel, byval_as_FBSYMBOL_ptr exitlabel) |
private sub | _emitScopeBegin (byval_as_FBSYMBOL_ptr s) |
private sub | _emitScopeEnd (byval_as_FBSYMBOL_ptr s) |
Variables | |
IRHLCCTX | ctx |
static IR_VTBL | irllvm_vtbl = |
anonymous enum |
Enumerator | |
---|---|
SECTION_HEAD | |
SECTION_BODY | |
SECTION_FOOT |
Definition at line 67 of file ir-llvm.bas.
private function_as_IRVREG_ptr _allocVreg | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype | ||
) |
private function_as_IRVREG_ptr _allocVrIdx | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_FBSYMBOL_ptr | symbol, | ||
byval_as_longint | ofs, | ||
byval_as_integer | mult, | ||
byval_as_IRVREG_ptr | vidx | ||
) |
private function_as_IRVREG_ptr _allocVrImm | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_longint | value | ||
) |
private function_as_IRVREG_ptr _allocVrImmF | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_double | value | ||
) |
private function_as_IRVREG_ptr _allocVrOfs | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_FBSYMBOL_ptr | symbol, | ||
byval_as_longint | ofs | ||
) |
private function_as_IRVREG_ptr _allocVrPtr | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_longint | ofs, | ||
byval_as_IRVREG_ptr | vidx | ||
) |
private function_as_IRVREG_ptr _allocVrVar | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_FBSYMBOL_ptr | symbol, | ||
byval_as_longint | ofs | ||
) |
private sub _emitAddr | ( | byval_as_integer | op, |
byval_as_IRVREG_ptr | v1, | ||
byval_as_IRVREG_ptr | vr | ||
) |
private sub _emitAsmBegin | ( | ) |
Definition at line 2157 of file ir-llvm.bas.
private sub _emitAsmEnd | ( | ) |
private sub _emitAsmSymb | ( | byval_as_FBSYMBOL_ptr | sym) |
private sub _emitAsmText | ( | byval_as_zstring_ptr | text) |
Definition at line 2161 of file ir-llvm.bas.
private function_as_integer _emitBegin | ( | ) |
sub _emitBop | ( | byval_as_integer | op, |
byval_as_IRVREG_ptr | v1, | ||
byval_as_IRVREG_ptr | v2, | ||
byval_as_IRVREG_ptr | vr, | ||
byval_as_FBSYMBOL_ptr | ex | ||
) |
private sub _emitBranch | ( | byval_as_integer | op, |
byval_as_FBSYMBOL_ptr | label | ||
) |
private sub _emitCall | ( | byval_as_FBSYMBOL_ptr | proc, |
byval_as_integer | bytestopop, | ||
byval_as_IRVREG_ptr | vr, | ||
byval_as_integer | level | ||
) |
private sub _emitCallPtr | ( | byval_as_IRVREG_ptr | v1, |
byval_as_IRVREG_ptr | vr, | ||
byval_as_integer | bytestopop, | ||
byval_as_integer | level | ||
) |
private sub _emitComment | ( | byval_as_zstring_ptr | text) |
private sub _emitConvert | ( | byval_as_IRVREG_ptr | v1, |
byval_as_IRVREG_ptr | v2 | ||
) |
Definition at line 1739 of file ir-llvm.bas.
sub _emitDBG | ( | byval_as_integer | op, |
byval_as_FBSYMBOL_ptr | proc, | ||
byval_as_integer | ex | ||
) |
private sub _emitDECL | ( | byval_as_FBSYMBOL_ptr | sym) |
private sub _emitEnd | ( | byval_as_double | tottime) |
private sub _emitFbctinfBegin | ( | ) |
private sub _emitFbctinfEnd | ( | ) |
private sub _emitFbctinfString | ( | byval_as_zstring_ptr | s) |
Definition at line 2291 of file ir-llvm.bas.
private sub _emitJmpTb | ( | byval_as_IRVREG_ptr | v1, |
byval_as_FBSYMBOL_ptr | tbsym, | ||
byval_as_ulongint_ptr | values, | ||
byval_as_FBSYMBOL_ptr_ptr | labels, | ||
byval_as_integer | labelcount, | ||
byval_as_FBSYMBOL_ptr | deflabel, | ||
byval_as_ulongint | minval, | ||
byval_as_ulongint | maxval | ||
) |
private sub _emitJumpPtr | ( | byval_as_IRVREG_ptr | v1) |
private sub _emitLabel | ( | byval_as_FBSYMBOL_ptr | label) |
private sub _emitLoad | ( | byval_as_IRVREG_ptr | v1) |
Definition at line 1848 of file ir-llvm.bas.
private sub _emitLoadRes | ( | byval_as_IRVREG_ptr | v1, |
byval_as_IRVREG_ptr | vr | ||
) |
private sub _emitMem | ( | byval_as_integer | op, |
byval_as_IRVREG_ptr | v1, | ||
byval_as_IRVREG_ptr | v2, | ||
byval_as_longint | bytes | ||
) |
private sub _emitProcBegin | ( | byval_as_FBSYMBOL_ptr | proc, |
byval_as_FBSYMBOL_ptr | initlabel | ||
) |
private sub _emitProcEnd | ( | byval_as_FBSYMBOL_ptr | proc, |
byval_as_FBSYMBOL_ptr | initlabel, | ||
byval_as_FBSYMBOL_ptr | exitlabel | ||
) |
private sub _emitPushArg | ( | byval_as_FBSYMBOL_ptr | param, |
byval_as_IRVREG_ptr | vr, | ||
byval_as_longint | udtlen, | ||
byval_as_integer | level | ||
) |
private sub _emitScopeBegin | ( | byval_as_FBSYMBOL_ptr | s) |
Definition at line 2368 of file ir-llvm.bas.
private sub _emitScopeEnd | ( | byval_as_FBSYMBOL_ptr | s) |
Definition at line 2371 of file ir-llvm.bas.
private sub _emitSpillRegs | ( | ) |
Definition at line 1844 of file ir-llvm.bas.
sub _emitStore | ( | byval_as_IRVREG_ptr | v1, |
byval_as_IRVREG_ptr | v2 | ||
) |
private sub _emitUop | ( | byval_as_integer | op, |
byval_as_IRVREG_ptr | v1, | ||
byval_as_IRVREG_ptr | vr | ||
) |
private sub _emitVarIniBegin | ( | byval_as_FBSYMBOL_ptr | sym) |
private sub _emitVarIniEnd | ( | byval_as_FBSYMBOL_ptr | sym) |
private sub _emitVarIniF | ( | byval_as_FBSYMBOL_ptr | sym, |
byval_as_double | value | ||
) |
private sub _emitVarIniI | ( | byval_as_FBSYMBOL_ptr | sym, |
byval_as_longint | value | ||
) |
private sub _emitVarIniOfs | ( | byval_as_FBSYMBOL_ptr | sym, |
byval_as_longint | ofs | ||
) |
private sub _emitVarIniPad | ( | byval_as_longint | bytes) |
Definition at line 2264 of file ir-llvm.bas.
private sub _emitVarIniScopeBegin | ( | ) |
Definition at line 2270 of file ir-llvm.bas.
private sub _emitVarIniScopeEnd | ( | ) |
private sub _emitVarIniStr | ( | byval_as_longint | varlength, |
byval_as_zstring_ptr | literal, | ||
byval_as_longint | litlength | ||
) |
private sub _emitVarIniWstr | ( | byval_as_longint | varlength, |
byval_as_wstring_ptr | literal, | ||
byval_as_longint | litlength | ||
) |
private sub _end | ( | void | ) |
private function_as_integer _getOptionValue | ( | byval_as_IR_OPTIONVALUE | opt) |
private sub _init | ( | ) |
private sub _procAllocArg | ( | byval_as_FBSYMBOL_ptr | proc, |
byval_as_FBSYMBOL_ptr | sym | ||
) |
private sub _procAllocLocal | ( | byval_as_FBSYMBOL_ptr | proc, |
byval_as_FBSYMBOL_ptr | sym | ||
) |
private sub _procAllocStaticVars | ( | byval_as_FBSYMBOL_ptr | head_sym) |
Definition at line 1092 of file ir-llvm.bas.
private sub _procBegin | ( | byval_as_FBSYMBOL_ptr | proc) |
Definition at line 1022 of file ir-llvm.bas.
private sub _procEnd | ( | byval_as_FBSYMBOL_ptr | proc) |
Definition at line 1026 of file ir-llvm.bas.
private sub _scopeBegin | ( | byval_as_FBSYMBOL_ptr | s) |
Definition at line 1086 of file ir-llvm.bas.
private sub _scopeEnd | ( | byval_as_FBSYMBOL_ptr | s) |
Definition at line 1089 of file ir-llvm.bas.
private sub _setVregDataType | ( | byval_as_IRVREG_ptr | v, |
byval_as_integer | dtype, | ||
byval_as_FBSYMBOL_ptr | subtype | ||
) |
private sub hBuildStrLit | ( | byref_as_string | ln, |
byval_as_integer | wantedlength, | ||
byval_as_zstring_ptr | z, | ||
byval_as_integer | length | ||
) |
private sub hBuildWstrLit | ( | byref_as_string | ln, |
byval_as_integer | wantedlength, | ||
byval_as_wstring_ptr | w, | ||
byval_as_integer | length | ||
) |
private sub hDoCall | ( | byval_as_zstring_ptr | pname, |
byval_as_FBSYMBOL_ptr | proc, | ||
byval_as_integer | bytestopop, | ||
byval_as_IRVREG_ptr | vr, | ||
byval_as_integer | level | ||
) |
private function_as_string hEmitArrayDecl | ( | byval_as_FBSYMBOL_ptr | sym) |
Definition at line 339 of file ir-llvm.bas.
private sub hEmitDataStmt | ( | ) |
private sub hEmitDecls | ( | byval_as_FBSYMBOL_ptr | s, |
byval_as_integer | procs = FALSE |
||
) |
private function_as_string hEmitFloat | ( | byval_as_double | value) |
Definition at line 1475 of file ir-llvm.bas.
private sub hEmitForwardDecls | ( | ) |
Definition at line 762 of file ir-llvm.bas.
private sub hEmitFTOIBuiltins | ( | ) |
private sub hEmitFuncProto | ( | byval_as_FBSYMBOL_ptr | s) |
private function_as_string hEmitInt | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_integer | value | ||
) |
private function_as_string hEmitLong | ( | byval_as_longint | value) |
private function_as_string hEmitParamName | ( | byval_as_FBSYMBOL_ptr | sym) |
Definition at line 178 of file ir-llvm.bas.
private function_as_string hEmitProcCallConv | ( | byval_as_FBSYMBOL_ptr | proc) |
private function_as_string hEmitProcHeader | ( | byval_as_FBSYMBOL_ptr | proc, |
byval_as_integer | is_proto | ||
) |
private function_as_string hEmitStrLitType | ( | byval_as_integer | length) |
private sub hEmitStruct | ( | byval_as_FBSYMBOL_ptr | s) |
private function_as_string hEmitSymType | ( | byval_as_FBSYMBOL_ptr | sym) |
Definition at line 484 of file ir-llvm.bas.
private function_as_string hEmitType | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_integer | is_result = FALSE |
||
) |
private sub hEmitUDT | ( | byval_as_FBSYMBOL_ptr | s) |
private sub hEmitVariable | ( | byval_as_FBSYMBOL_ptr | sym) |
private function_as_zstring_ptr hGetBopCode | ( | byval_as_integer | op, |
byval_as_integer | dtype | ||
) |
Definition at line 1539 of file ir-llvm.bas.
private function_as_string hGetUDTName | ( | byval_as_FBSYMBOL_ptr | sym) |
Definition at line 286 of file ir-llvm.bas.
private sub hLoadVreg | ( | byval_as_IRVREG_ptr | v) |
private function_as_IRVREG_ptr hNewVR | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype, | ||
byval_as_integer | vtype | ||
) |
private sub hPrepareAddress | ( | byval_as_IRVREG_ptr | v) |
Definition at line 1251 of file ir-llvm.bas.
private sub hVarIniElementType | ( | byval_as_integer | dtype, |
byval_as_FBSYMBOL_ptr | subtype | ||
) |
Definition at line 2192 of file ir-llvm.bas.
private sub hVarIniSeparator | ( | ) |
Definition at line 2201 of file ir-llvm.bas.
private function_as_string hVregToStr | ( | byval_as_IRVREG_ptr | vreg) |
Definition at line 1484 of file ir-llvm.bas.
private sub hWriteFTOI | ( | byref_as_string | fname, |
byval_as_integer | rtype, | ||
byval_as_integer | ptype | ||
) |
private sub hWriteLabel | ( | byval_as_zstring_ptr | id) |
Definition at line 172 of file ir-llvm.bas.
private sub hWriteLine | ( | byref_as_string | ln) |
Definition at line 154 of file ir-llvm.bas.
IRHLCCTX ctx |
Definition at line 135 of file ir-llvm.bas.
|
static |
Definition at line 2374 of file ir-llvm.bas.