annotate gen/llvmhelpers.h @ 305:2b72433d5c8c trunk

[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support. Fixed problems with label collisions when using labels inside inline asm. LabelStatement is now easily reached given its Identifier, which should be useful elsewhere too. Enabled inline asm for building the lib/compiler/llvmdc runtime code, fixing branches out of asm makes this possible.
author lindquist
date Fri, 27 Jun 2008 22:04:35 +0200
parents bef811104734
children d59c363fccad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
1 #ifndef LLVMDC_GEN_LLVMHELPERS_H
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
2 #define LLVMDC_GEN_LLVMHELPERS_H
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
3
302
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
4 #include "statement.h"
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
5
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
6 // dynamic memory helpers
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
7 LLValue* DtoNew(Type* newtype);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
8 void DtoDeleteMemory(LLValue* ptr);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
9 void DtoDeleteClass(LLValue* inst);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
10 void DtoDeleteInterface(LLValue* inst);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
11 void DtoDeleteArray(DValue* arr);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
12
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
13 // assertion generator
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
14 void DtoAssert(Loc* loc, DValue* msg);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
15
305
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents: 302
diff changeset
16 // return the LabelStatement from the current function with the given identifier or NULL if not found
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents: 302
diff changeset
17 LabelStatement* DtoLabelStatement(Identifier* ident);
302
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
18 // emit goto
305
2b72433d5c8c [svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
lindquist
parents: 302
diff changeset
19 void DtoGoto(Loc* loc, Identifier* target, TryFinallyStatement* enclosingtryfinally);
302
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
20
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
21 // generates IR for finally blocks between the 'start' and 'end' statements
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
22 // will begin with the finally block belonging to 'start' and does not include
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
23 // the finally block of 'end'
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
24 void DtoFinallyBlocks(TryFinallyStatement* start, TryFinallyStatement* end);
bef811104734 [svn r323] Branching out of inline asm works.
ChristianK
parents: 284
diff changeset
25
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
26 // nested variable/class helpers
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
27 LLValue* DtoNestedContext(FuncDeclaration* func);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
28 LLValue* DtoNestedVariable(VarDeclaration* vd);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
29
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
30 // basic operations
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
31 void DtoAssign(DValue* lhs, DValue* rhs);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
32
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
33 // casts
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
34 DValue* DtoCastInt(DValue* val, Type* to);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
35 DValue* DtoCastPtr(DValue* val, Type* to);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
36 DValue* DtoCastFloat(DValue* val, Type* to);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
37 DValue* DtoCast(DValue* val, Type* to);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
38
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
39 // is template instance check
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
40 bool DtoIsTemplateInstance(Dsymbol* s);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
41
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
42 // generates lazy static initialization code for a global variable
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
43 void DtoLazyStaticInit(bool istempl, LLValue* gvar, Initializer* init, Type* t);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
44
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
45 // these are all basically drivers for the codegeneration called by the main loop
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
46 void DtoResolveDsymbol(Dsymbol* dsym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
47 void DtoDeclareDsymbol(Dsymbol* dsym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
48 void DtoDefineDsymbol(Dsymbol* dsym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
49 void DtoConstInitDsymbol(Dsymbol* dsym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
50 void DtoConstInitGlobal(VarDeclaration* vd);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
51 void DtoEmptyResolveList();
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
52 void DtoEmptyDeclareList();
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
53 void DtoEmptyConstInitList();
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
54 void DtoEmptyAllLists();
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
55 void DtoForceDeclareDsymbol(Dsymbol* dsym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
56 void DtoForceConstInitDsymbol(Dsymbol* dsym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
57 void DtoForceDefineDsymbol(Dsymbol* dsym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
58
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
59 // initializer helpers
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
60 LLConstant* DtoConstInitializer(Type* type, Initializer* init);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
61 LLConstant* DtoConstFieldInitializer(Type* type, Initializer* init);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
62 DValue* DtoInitializer(Initializer* init);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
63
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
64 // annotation generator
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
65 void DtoAnnotation(const char* str);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
66
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
67 // getting typeinfo of type, base=true casts to object.TypeInfo
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
68 LLConstant* DtoTypeInfoOf(Type* ty, bool base=true);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
69
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
70 // binary operations
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
71 DValue* DtoBinAdd(DValue* lhs, DValue* rhs);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
72 DValue* DtoBinSub(DValue* lhs, DValue* rhs);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
73 DValue* DtoBinMul(DValue* lhs, DValue* rhs);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
74 DValue* DtoBinDiv(DValue* lhs, DValue* rhs);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
75 DValue* DtoBinRem(DValue* lhs, DValue* rhs);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
76
284
70c370e97944 [svn r305] Started support for custom class allocators/deallocators. Allocators with more than one argument still need to be fixed.
lindquist
parents: 244
diff changeset
77 // target stuff
70c370e97944 [svn r305] Started support for custom class allocators/deallocators. Allocators with more than one argument still need to be fixed.
lindquist
parents: 244
diff changeset
78 void findDefaultTarget();
70c370e97944 [svn r305] Started support for custom class allocators/deallocators. Allocators with more than one argument still need to be fixed.
lindquist
parents: 244
diff changeset
79
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents:
diff changeset
80 #endif