Mercurial > projects > ldc
comparison ir/irstruct.h @ 193:aca17e55b7a5 trunk
[svn r209] Fixed: exotic array to pointer casts were broken.
Changed: classes now have opaque vtables.
author | lindquist |
---|---|
date | Mon, 12 May 2008 18:44:11 +0200 |
parents | a123dca8349b |
children | ba47ac346ddd |
comparison
equal
deleted
inserted
replaced
192:67ed21bf16af | 193:aca17e55b7a5 |
---|---|
9 struct IrInterface : IrBase | 9 struct IrInterface : IrBase |
10 { | 10 { |
11 BaseClass* base; | 11 BaseClass* base; |
12 ClassDeclaration* decl; | 12 ClassDeclaration* decl; |
13 | 13 |
14 #if OPAQUE_VTBLS | |
15 const llvm::ArrayType* vtblTy; | |
16 llvm::ConstantArray* vtblInit; | |
17 #else | |
14 const llvm::StructType* vtblTy; | 18 const llvm::StructType* vtblTy; |
15 llvm::ConstantStruct* vtblInit; | 19 llvm::ConstantStruct* vtblInit; |
20 #endif | |
16 llvm::GlobalVariable* vtbl; | 21 llvm::GlobalVariable* vtbl; |
17 | 22 |
18 const llvm::StructType* infoTy; | 23 const llvm::StructType* infoTy; |
19 llvm::ConstantStruct* infoInit; | 24 llvm::ConstantStruct* infoInit; |
20 llvm::Constant* info; | 25 llvm::Constant* info; |
21 | 26 |
22 int index; | 27 int index; |
23 | 28 |
29 #if OPAQUE_VTBLS | |
30 IrInterface(BaseClass* b, const llvm::ArrayType* vt); | |
31 #else | |
24 IrInterface(BaseClass* b, const llvm::StructType* vt); | 32 IrInterface(BaseClass* b, const llvm::StructType* vt); |
33 #endif | |
25 ~IrInterface(); | 34 ~IrInterface(); |
26 }; | 35 }; |
27 | 36 |
28 ////////////////////////////////////////////////////////////////////////////// | 37 ////////////////////////////////////////////////////////////////////////////// |
29 ////////////////////////////////////////////////////////////////////////////// | 38 ////////////////////////////////////////////////////////////////////////////// |
65 | 74 |
66 bool defined; | 75 bool defined; |
67 bool constinited; | 76 bool constinited; |
68 | 77 |
69 llvm::GlobalVariable* vtbl; | 78 llvm::GlobalVariable* vtbl; |
79 #if OPAQUE_VTBLS | |
80 llvm::ConstantArray* constVtbl; | |
81 #else | |
70 llvm::ConstantStruct* constVtbl; | 82 llvm::ConstantStruct* constVtbl; |
83 #endif | |
71 llvm::GlobalVariable* init; | 84 llvm::GlobalVariable* init; |
72 llvm::Constant* constInit; | 85 llvm::Constant* constInit; |
73 llvm::GlobalVariable* classInfo; | 86 llvm::GlobalVariable* classInfo; |
74 llvm::Constant* constClassInfo; | 87 llvm::Constant* constClassInfo; |
75 bool hasUnions; | 88 bool hasUnions; |