comparison gen/llvmhelpers.h @ 244:a95056b3c996 trunk

[svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB. Did a lot of smaller cleans up here and there. Replaced more llvm::Foo with LLFoo for common stuff. Split up tollvm.cpp.
author lindquist
date Mon, 09 Jun 2008 09:37:08 +0200
parents
children 70c370e97944
comparison
equal deleted inserted replaced
243:4d006f7b2ada 244:a95056b3c996
1 #ifndef LLVMDC_GEN_LLVMHELPERS_H
2 #define LLVMDC_GEN_LLVMHELPERS_H
3
4 // dynamic memory helpers
5 LLValue* DtoNew(Type* newtype);
6 void DtoDeleteMemory(LLValue* ptr);
7 void DtoDeleteClass(LLValue* inst);
8 void DtoDeleteInterface(LLValue* inst);
9 void DtoDeleteArray(DValue* arr);
10
11 // assertion generator
12 void DtoAssert(Loc* loc, DValue* msg);
13
14 // nested variable/class helpers
15 LLValue* DtoNestedContext(FuncDeclaration* func);
16 LLValue* DtoNestedVariable(VarDeclaration* vd);
17
18 // basic operations
19 void DtoAssign(DValue* lhs, DValue* rhs);
20
21 // casts
22 DValue* DtoCastInt(DValue* val, Type* to);
23 DValue* DtoCastPtr(DValue* val, Type* to);
24 DValue* DtoCastFloat(DValue* val, Type* to);
25 DValue* DtoCast(DValue* val, Type* to);
26
27 // is template instance check
28 bool DtoIsTemplateInstance(Dsymbol* s);
29
30 // generates lazy static initialization code for a global variable
31 void DtoLazyStaticInit(bool istempl, LLValue* gvar, Initializer* init, Type* t);
32
33 // these are all basically drivers for the codegeneration called by the main loop
34 void DtoResolveDsymbol(Dsymbol* dsym);
35 void DtoDeclareDsymbol(Dsymbol* dsym);
36 void DtoDefineDsymbol(Dsymbol* dsym);
37 void DtoConstInitDsymbol(Dsymbol* dsym);
38 void DtoConstInitGlobal(VarDeclaration* vd);
39 void DtoEmptyResolveList();
40 void DtoEmptyDeclareList();
41 void DtoEmptyConstInitList();
42 void DtoEmptyAllLists();
43 void DtoForceDeclareDsymbol(Dsymbol* dsym);
44 void DtoForceConstInitDsymbol(Dsymbol* dsym);
45 void DtoForceDefineDsymbol(Dsymbol* dsym);
46
47 // initializer helpers
48 LLConstant* DtoConstInitializer(Type* type, Initializer* init);
49 LLConstant* DtoConstFieldInitializer(Type* type, Initializer* init);
50 DValue* DtoInitializer(Initializer* init);
51
52 // annotation generator
53 void DtoAnnotation(const char* str);
54
55 // getting typeinfo of type, base=true casts to object.TypeInfo
56 LLConstant* DtoTypeInfoOf(Type* ty, bool base=true);
57
58 // binary operations
59 DValue* DtoBinAdd(DValue* lhs, DValue* rhs);
60 DValue* DtoBinSub(DValue* lhs, DValue* rhs);
61 DValue* DtoBinMul(DValue* lhs, DValue* rhs);
62 DValue* DtoBinDiv(DValue* lhs, DValue* rhs);
63 DValue* DtoBinRem(DValue* lhs, DValue* rhs);
64
65 #endif