Mercurial > projects > ldc
comparison dmd/aggregate.h @ 73:b706170e24a9 trunk
[svn r77] Fixed foreach on slice.
Fixed some nested function problems when accessing outer function parameters.
Major changes to handling of structs.
Initial support for unions.
Probably more...
author | lindquist |
---|---|
date | Wed, 31 Oct 2007 03:11:32 +0100 |
parents | d7e764e62462 |
children | 714057ff2dbb |
comparison
equal
deleted
inserted
replaced
72:d7e764e62462 | 73:b706170e24a9 |
---|---|
17 | 17 |
18 #include "root.h" | 18 #include "root.h" |
19 #include "dsymbol.h" | 19 #include "dsymbol.h" |
20 | 20 |
21 #include <vector> | 21 #include <vector> |
22 #include <set> | |
23 #include <map> | |
22 | 24 |
23 struct Identifier; | 25 struct Identifier; |
24 struct Type; | 26 struct Type; |
25 struct TypeFunction; | 27 struct TypeFunction; |
26 struct Expression; | 28 struct Expression; |
99 bool llvmInProgress; | 101 bool llvmInProgress; |
100 llvm::Type* llvmType; | 102 llvm::Type* llvmType; |
101 llvm::Constant* llvmVtbl; | 103 llvm::Constant* llvmVtbl; |
102 llvm::ConstantStruct* llvmConstVtbl; | 104 llvm::ConstantStruct* llvmConstVtbl; |
103 llvm::Constant* llvmInitZ; | 105 llvm::Constant* llvmInitZ; |
104 virtual void offsetToIndex(Type* t, unsigned os, std::vector<unsigned>& result); // converts a DMD field offsets to LLVM struct index vector | 106 bool llvmHasUnions; |
107 virtual size_t offsetToIndex(Type* t, unsigned os, std::vector<unsigned>& result); // converts a DMD field offsets to LLVM struct index vector | |
105 | 108 |
106 AggregateDeclaration *isAggregateDeclaration() { return this; } | 109 AggregateDeclaration *isAggregateDeclaration() { return this; } |
107 }; | 110 }; |
108 | 111 |
109 struct AnonymousAggregateDeclaration : AggregateDeclaration | 112 struct AnonymousAggregateDeclaration : AggregateDeclaration |
235 void toDt(dt_t **pdt); | 238 void toDt(dt_t **pdt); |
236 void toDt2(dt_t **pdt, ClassDeclaration *cd); | 239 void toDt2(dt_t **pdt, ClassDeclaration *cd); |
237 | 240 |
238 Symbol *vtblsym; | 241 Symbol *vtblsym; |
239 | 242 |
240 virtual void offsetToIndex(Type* t, unsigned os, std::vector<unsigned>& result); | 243 virtual size_t offsetToIndex(Type* t, unsigned os, std::vector<unsigned>& result); |
241 | 244 |
242 ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; } | 245 ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; } |
243 }; | 246 }; |
244 | 247 |
245 struct InterfaceDeclaration : ClassDeclaration | 248 struct InterfaceDeclaration : ClassDeclaration |