annotate ir/irstruct.h @ 252:e3355ce5444b trunk

[svn r269] Fixed dwarf debug info for structs.
author lindquist
date Thu, 12 Jun 2008 16:58:26 +0200
parents a95056b3c996
children 7ade5e035beb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
1 #ifndef LLVMDC_IR_IRSTRUCT_H
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
2 #define LLVMDC_IR_IRSTRUCT_H
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
3
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
4 #include "ir/ir.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
5
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
6 #include <vector>
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
7 #include <map>
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
8
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
9 struct IrInterface : IrBase
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
10 {
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
11 BaseClass* base;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
12 ClassDeclaration* decl;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
13
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
14 #if OPAQUE_VTBLS
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
15 const LLArrayType* vtblTy;
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
16 LLConstantArray* vtblInit;
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
17 #else
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
18 const LLStructType* vtblTy;
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
19 LLConstantStruct* vtblInit;
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
20 #endif
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
21 LLGlobalVariable* vtbl;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
22
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
23 const LLStructType* infoTy;
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
24 LLConstantStruct* infoInit;
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
25 LLConstant* info;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
26
137
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
27 int index;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
28
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
29 #if OPAQUE_VTBLS
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
30 IrInterface(BaseClass* b, const LLArrayType* vt);
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
31 #else
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
32 IrInterface(BaseClass* b, const LLStructType* vt);
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
33 #endif
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
34 ~IrInterface();
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
35 };
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
36
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
37 //////////////////////////////////////////////////////////////////////////////
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
38 //////////////////////////////////////////////////////////////////////////////
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
39 //////////////////////////////////////////////////////////////////////////////
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
40
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
41 // represents a struct or class
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
42 struct IrStruct : IrBase
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
43 {
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
44 struct Offset
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
45 {
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
46 VarDeclaration* var;
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 199
diff changeset
47 const LLType* type;
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
48 LLConstant* init;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
49
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 199
diff changeset
50 Offset(VarDeclaration* v, const LLType* ty)
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
51 : var(v), type(ty), init(NULL) {}
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
52 };
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
53
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
54 typedef std::multimap<unsigned, Offset> OffsetMap;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
55 typedef std::vector<VarDeclaration*> VarDeclVector;
142
a123dca8349b [svn r146] fixed some potential problems with mismatch in order of interfaces in class data layout
lindquist
parents: 140
diff changeset
56 typedef std::map<ClassDeclaration*, IrInterface*> InterfaceMap;
a123dca8349b [svn r146] fixed some potential problems with mismatch in order of interfaces in class data layout
lindquist
parents: 140
diff changeset
57 typedef InterfaceMap::iterator InterfaceMapIter;
a123dca8349b [svn r146] fixed some potential problems with mismatch in order of interfaces in class data layout
lindquist
parents: 140
diff changeset
58 typedef std::vector<IrInterface*> InterfaceVector;
a123dca8349b [svn r146] fixed some potential problems with mismatch in order of interfaces in class data layout
lindquist
parents: 140
diff changeset
59 typedef InterfaceVector::iterator InterfaceVectorIter;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
60
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
61 public:
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
62 IrStruct(Type*);
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
63 virtual ~IrStruct();
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
64
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
65 Type* type;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
66 llvm::PATypeHolder recty;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
67 OffsetMap offsets;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
68 VarDeclVector defaultFields;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
69
142
a123dca8349b [svn r146] fixed some potential problems with mismatch in order of interfaces in class data layout
lindquist
parents: 140
diff changeset
70 InterfaceMap interfaceMap;
a123dca8349b [svn r146] fixed some potential problems with mismatch in order of interfaces in class data layout
lindquist
parents: 140
diff changeset
71 InterfaceVector interfaceVec;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
72 const llvm::ArrayType* interfaceInfosTy;
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
73 LLGlobalVariable* interfaceInfos;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
74
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
75 bool defined;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
76 bool constinited;
137
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
77
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
78 LLGlobalVariable* vtbl;
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
79 #if OPAQUE_VTBLS
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
80 LLConstant* constVtbl;
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
81 #else
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
82 LLConstantStruct* constVtbl;
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 142
diff changeset
83 #endif
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
84 LLGlobalVariable* init;
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
85 LLConstant* constInit;
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
86 LLGlobalVariable* classInfo;
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
87 LLConstant* constClassInfo;
137
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
88 bool hasUnions;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
89 DUnion* dunion;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
90 bool classDeclared;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
91 bool classDefined;
252
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
92
e3355ce5444b [svn r269] Fixed dwarf debug info for structs.
lindquist
parents: 244
diff changeset
93 LLGlobalVariable* dwarfComposite;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
94 };
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
95
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
96 #endif