comparison gen/tollvm.h @ 203:e881c9b1c738 trunk

[svn r219] Fixed: the tango/lib/gc/basic garbage collector now compiles and links into an executable (change in tango/lib/llvmdc-posix.mak), closes #5 . Changed: removed the crappy realloc based dynamic memory runtime and started moving over to DMD style runtime support, part of moving to real GC. Fixed: dynamic arrays now use GC runtime for allocating memory. Fixed: new expression now use GC for allocating memory. Changed: revamped the dynamic array support routines related to dynamic memory. Fixed: assertions no longer create exsessive allocas. Changed: misc. minor cleanups.
author lindquist
date Tue, 13 May 2008 14:42:09 +0200
parents aca17e55b7a5
children 9d44ec83acd1
comparison
equal deleted inserted replaced
202:56e0c5b1d428 203:e881c9b1c738
37 37
38 // some types 38 // some types
39 const llvm::Type* DtoSize_t(); 39 const llvm::Type* DtoSize_t();
40 const llvm::StructType* DtoInterfaceInfoType(); 40 const llvm::StructType* DtoInterfaceInfoType();
41 41
42 // getting typeinfo of type
43 llvm::Constant* DtoTypeInfoOf(Type* ty);
44
42 // initializer helpers 45 // initializer helpers
43 llvm::Constant* DtoConstInitializer(Type* type, Initializer* init); 46 llvm::Constant* DtoConstInitializer(Type* type, Initializer* init);
44 llvm::Constant* DtoConstFieldInitializer(Type* type, Initializer* init); 47 llvm::Constant* DtoConstFieldInitializer(Type* type, Initializer* init);
45 DValue* DtoInitializer(Initializer* init); 48 DValue* DtoInitializer(Initializer* init);
46 49
55 llvm::Value* DtoGEP(llvm::Value* ptr, const std::vector<unsigned>& src, const std::string& var, llvm::BasicBlock* bb=NULL); 58 llvm::Value* DtoGEP(llvm::Value* ptr, const std::vector<unsigned>& src, const std::string& var, llvm::BasicBlock* bb=NULL);
56 llvm::Value* DtoGEPi(llvm::Value* ptr, unsigned i0, const std::string& var, llvm::BasicBlock* bb=NULL); 59 llvm::Value* DtoGEPi(llvm::Value* ptr, unsigned i0, const std::string& var, llvm::BasicBlock* bb=NULL);
57 llvm::Value* DtoGEPi(llvm::Value* ptr, unsigned i0, unsigned i1, const std::string& var, llvm::BasicBlock* bb=NULL); 60 llvm::Value* DtoGEPi(llvm::Value* ptr, unsigned i0, unsigned i1, const std::string& var, llvm::BasicBlock* bb=NULL);
58 61
59 // dynamic memory helpers 62 // dynamic memory helpers
60 llvm::Value* DtoRealloc(llvm::Value* ptr, const llvm::Type* ty); 63 llvm::Value* DtoNew(Type* newtype);
61 llvm::Value* DtoRealloc(llvm::Value* ptr, llvm::Value* len);
62 64
63 // assertion generator 65 // assertion generator
64 void DtoAssert(Loc* loc, DValue* msg); 66 void DtoAssert(Loc* loc, DValue* msg);
65 67
66 // nested variable/class helpers 68 // nested variable/class helpers
77 llvm::ConstantFP* DtoConstFP(Type* t, long double value); 79 llvm::ConstantFP* DtoConstFP(Type* t, long double value);
78 80
79 llvm::Constant* DtoConstString(const char*); 81 llvm::Constant* DtoConstString(const char*);
80 llvm::Constant* DtoConstStringPtr(const char* str, const char* section = 0); 82 llvm::Constant* DtoConstStringPtr(const char* str, const char* section = 0);
81 llvm::Constant* DtoConstBool(bool); 83 llvm::Constant* DtoConstBool(bool);
82 llvm::Constant* DtoConstNullPtr(const llvm::Type* t);
83 84
84 // is template instance check 85 // is template instance check
85 bool DtoIsTemplateInstance(Dsymbol* s); 86 bool DtoIsTemplateInstance(Dsymbol* s);
86 87
87 // generates lazy static initialization code for a global variable 88 // generates lazy static initialization code for a global variable