Mercurial > projects > ldc
comparison gen/rttibuilder.h @ 1383:f15a2d131ceb
Update !ClassInfo generation to use !RTTIBuilder, slight update of !RTTIBuilder .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Sun, 17 May 2009 16:27:01 +0200 |
parents | a0a4d4dac1a4 |
children | 68a0e361fdce |
comparison
equal
deleted
inserted
replaced
1382:a0a4d4dac1a4 | 1383:f15a2d131ceb |
---|---|
20 llvm::SmallVector<llvm::Constant*, 10> inits; | 20 llvm::SmallVector<llvm::Constant*, 10> inits; |
21 | 21 |
22 RTTIBuilder(ClassDeclaration* base_class); | 22 RTTIBuilder(ClassDeclaration* base_class); |
23 | 23 |
24 void push(llvm::Constant* C); | 24 void push(llvm::Constant* C); |
25 void push_null(Type* T); | |
25 void push_null_vp(); | 26 void push_null_vp(); |
26 void push_null_void_array(); | 27 void push_null_void_array(); |
27 void push_uint(unsigned u); | 28 void push_uint(unsigned u); |
28 void push_size(uint64_t s); | 29 void push_size(uint64_t s); |
29 void push_string(const char* str); | 30 void push_string(const char* str); |
30 void push_typeinfo(Type* t); | 31 void push_typeinfo(Type* t); |
31 void push_classinfo(ClassDeclaration* cd); | 32 void push_classinfo(ClassDeclaration* cd); |
32 void push_funcptr(FuncDeclaration* fd); | 33 |
34 /// pushes the function pointer or a null void* if it cannot. | |
35 void push_funcptr(FuncDeclaration* fd, Type* castto = NULL); | |
36 | |
37 /// pushes the array slice given. | |
38 void push_array(uint64_t dim, llvm::Constant * ptr); | |
39 | |
40 /// pushes void[] slice, dim is used directly, ptr is cast to void* . | |
33 void push_void_array(uint64_t dim, llvm::Constant* ptr); | 41 void push_void_array(uint64_t dim, llvm::Constant* ptr); |
42 | |
43 /// pushes void[] slice with data. | |
44 /// CI is the constant initializer the array should point to, the length | |
45 /// and ptr are resolved automatically | |
34 void push_void_array(llvm::Constant* CI, Type* valtype, Dsymbol* mangle_sym); | 46 void push_void_array(llvm::Constant* CI, Type* valtype, Dsymbol* mangle_sym); |
47 | |
48 /// pushes valtype[] slice with data. | |
49 /// CI is the constant initializer that .ptr should point to | |
50 /// dim is .length member directly | |
51 /// valtype provides the D element type, .ptr is cast to valtype->pointerTo() | |
52 /// mangle_sym provides the mangle prefix for the symbol generated. | |
35 void push_array(llvm::Constant* CI, uint64_t dim, Type* valtype, Dsymbol* mangle_sym); | 53 void push_array(llvm::Constant* CI, uint64_t dim, Type* valtype, Dsymbol* mangle_sym); |
36 | 54 |
37 /// Creates the initializer constant and assigns it to the global. | 55 /// Creates the initializer constant and assigns it to the global. |
38 void finalize(IrGlobal* tid); | 56 void finalize(IrGlobal* tid); |
57 | |
58 /// Creates the initializer constant and assigns it to the global. | |
59 llvm::Constant* get_constant(); | |
39 }; | 60 }; |
40 | 61 |
41 #endif | 62 #endif |