Mercurial > projects > ldc
annotate gen/rttibuilder.h @ 1376:a5d0e04298a8
Cleaned up TypeInfo_Tuple generation.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Sun, 17 May 2009 05:07:51 +0200 |
parents | 63f4afd01036 |
children | a0a4d4dac1a4 |
rev | line source |
---|---|
1374
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
1 #ifndef __LDC_GEN_RTTIBUILDER_H__ |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
2 #define __LDC_GEN_RTTIBUILDER_H__ |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
3 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
4 #include "llvm/Constant.h" |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
5 #include "llvm/ADT/SmallVector.h" |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
6 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
7 struct ClassDeclaration; |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
8 struct TypeClass; |
1376
a5d0e04298a8
Cleaned up TypeInfo_Tuple generation.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1375
diff
changeset
|
9 struct Type; |
1374
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
10 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
11 struct IrStruct; |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
12 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
13 struct TypeInfoBuilder |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
14 { |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
15 ClassDeclaration* base; |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
16 TypeClass* basetype; |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
17 IrStruct* baseir; |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
18 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
19 // 10 is enough for any D1 typeinfo |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
20 llvm::SmallVector<llvm::Constant*, 10> inits; |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
21 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
22 TypeInfoBuilder(ClassDeclaration* base_class); |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
23 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
24 void push(llvm::Constant* C); |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
25 void push_null_vp(); |
1375
63f4afd01036
Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1374
diff
changeset
|
26 void push_null_void_array(); |
63f4afd01036
Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1374
diff
changeset
|
27 void push_uint(unsigned u); |
63f4afd01036
Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1374
diff
changeset
|
28 void push_size(uint64_t s); |
63f4afd01036
Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1374
diff
changeset
|
29 void push_string(const char* str); |
1374
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
30 void push_typeinfo(Type* t); |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
31 void push_classinfo(ClassDeclaration* cd); |
1375
63f4afd01036
Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1374
diff
changeset
|
32 void push_funcptr(FuncDeclaration* fd); |
1376
a5d0e04298a8
Cleaned up TypeInfo_Tuple generation.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1375
diff
changeset
|
33 void push_void_array(uint64_t dim, llvm::Constant* ptr); |
a5d0e04298a8
Cleaned up TypeInfo_Tuple generation.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1375
diff
changeset
|
34 void push_void_array(llvm::Constant* CI, Type* valtype, Dsymbol* mangle_sym); |
a5d0e04298a8
Cleaned up TypeInfo_Tuple generation.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1375
diff
changeset
|
35 void push_array(llvm::Constant* CI, uint64_t dim, Type* valtype, Dsymbol* mangle_sym); |
1375
63f4afd01036
Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1374
diff
changeset
|
36 |
63f4afd01036
Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1374
diff
changeset
|
37 /// Creates the initializer constant and assigns it to the global. |
1374
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
38 void finalize(IrGlobal* tid); |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
39 }; |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
40 |
e630ff79e10d
Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
diff
changeset
|
41 #endif |