comparison dmd/aggregate.h @ 336:aaade6ded589 trunk

[svn r357] Merged DMD 1.033
author lindquist
date Sat, 12 Jul 2008 19:38:31 +0200
parents 5acec6b2eef8
children 340acf1535d0
comparison
equal deleted inserted replaced
335:17b844102023 336:aaade6ded589
62 // 0: no size 62 // 0: no size
63 // 1: size is correct 63 // 1: size is correct
64 // 2: cannot determine size; fwd referenced 64 // 2: cannot determine size; fwd referenced
65 int isdeprecated; // !=0 if deprecated 65 int isdeprecated; // !=0 if deprecated
66 Scope *scope; // !=NULL means context to use 66 Scope *scope; // !=NULL means context to use
67 FuncDeclarations dtors; // Array of destructors
68 FuncDeclaration *dtor; // aggregate destructor
69 67
70 // Special member functions 68 // Special member functions
71 InvariantDeclaration *inv; // invariant 69 InvariantDeclaration *inv; // invariant
72 NewDeclaration *aggNew; // allocator 70 NewDeclaration *aggNew; // allocator
73 DeleteDeclaration *aggDelete; // deallocator 71 DeleteDeclaration *aggDelete; // deallocator
72
73 FuncDeclarations dtors; // Array of destructors
74 FuncDeclaration *dtor; // aggregate destructor
74 75
75 #ifdef IN_GCC 76 #ifdef IN_GCC
76 Array methods; // flat list of all methods for debug information 77 Array methods; // flat list of all methods for debug information
77 #endif 78 #endif
78 79
117 }; 118 };
118 119
119 struct StructDeclaration : AggregateDeclaration 120 struct StructDeclaration : AggregateDeclaration
120 { 121 {
121 int zeroInit; // !=0 if initialize with 0 fill 122 int zeroInit; // !=0 if initialize with 0 fill
123 #if DMDV2
124 int hasIdentityAssign; // !=0 if has identity opAssign
125 FuncDeclaration *cpctor; // generated copy-constructor, if any
126
127 FuncDeclarations postblits; // Array of postblit functions
128 FuncDeclaration *postblit; // aggregate postblit
129 #endif
122 130
123 StructDeclaration(Loc loc, Identifier *id); 131 StructDeclaration(Loc loc, Identifier *id);
124 Dsymbol *syntaxCopy(Dsymbol *s); 132 Dsymbol *syntaxCopy(Dsymbol *s);
125 void semantic(Scope *sc); 133 void semantic(Scope *sc);
126 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 134 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
127 char *mangle(); 135 char *mangle();
128 char *kind(); 136 const char *kind();
129 Expression *cloneMembers(); 137 Expression *cloneMembers();
130 void toDocBuffer(OutBuffer *buf); 138 void toDocBuffer(OutBuffer *buf);
131 139
132 PROT getAccess(Dsymbol *smember); // determine access to smember 140 PROT getAccess(Dsymbol *smember); // determine access to smember
133 141
134 void toObjFile(); // compile to .obj file 142 void toObjFile(int multiobj); // compile to .obj file
135 void toDt(dt_t **pdt); 143 void toDt(dt_t **pdt);
136 void toDebug(); // to symbolic debug info 144 void toDebug(); // to symbolic debug info
137 145
138 StructDeclaration *isStructDeclaration() { return this; } 146 StructDeclaration *isStructDeclaration() { return this; }
139 }; 147 };
140 148
141 struct UnionDeclaration : StructDeclaration 149 struct UnionDeclaration : StructDeclaration
142 { 150 {
143 UnionDeclaration(Loc loc, Identifier *id); 151 UnionDeclaration(Loc loc, Identifier *id);
144 Dsymbol *syntaxCopy(Dsymbol *s); 152 Dsymbol *syntaxCopy(Dsymbol *s);
145 char *kind(); 153 const char *kind();
146 154
147 UnionDeclaration *isUnionDeclaration() { return this; } 155 UnionDeclaration *isUnionDeclaration() { return this; }
148 }; 156 };
149 157
150 struct BaseClass 158 struct BaseClass
166 174
167 int fillVtbl(ClassDeclaration *cd, Array *vtbl, int newinstance); 175 int fillVtbl(ClassDeclaration *cd, Array *vtbl, int newinstance);
168 void copyBaseInterfaces(BaseClasses *); 176 void copyBaseInterfaces(BaseClasses *);
169 }; 177 };
170 178
171 #if V2 179 #if DMDV2
172 #define CLASSINFO_SIZE (0x3C+16) // value of ClassInfo.size 180 #define CLASSINFO_SIZE (0x3C+16) // value of ClassInfo.size
173 #else 181 #else
174 #define CLASSINFO_SIZE (0x3C+12) // value of ClassInfo.size 182 #define CLASSINFO_SIZE (0x3C+12) // value of ClassInfo.size
175 #endif 183 #endif
176 184
216 224
217 #define OFFSET_RUNTIME 0x76543210 225 #define OFFSET_RUNTIME 0x76543210
218 virtual int isBaseOf(ClassDeclaration *cd, int *poffset); 226 virtual int isBaseOf(ClassDeclaration *cd, int *poffset);
219 227
220 Dsymbol *search(Loc, Identifier *ident, int flags); 228 Dsymbol *search(Loc, Identifier *ident, int flags);
221 #if V2 229 #if DMDV2
222 int isFuncHidden(FuncDeclaration *fd); 230 int isFuncHidden(FuncDeclaration *fd);
223 #endif 231 #endif
224 FuncDeclaration *findFunc(Identifier *ident, TypeFunction *tf); 232 FuncDeclaration *findFunc(Identifier *ident, TypeFunction *tf);
225 void interfaceSemantic(Scope *sc); 233 void interfaceSemantic(Scope *sc);
226 int isNested(); 234 int isNested();
227 int isCOMclass(); 235 int isCOMclass();
228 virtual int isCOMinterface(); 236 virtual int isCOMinterface();
229 #if V2 237 #if DMDV2
230 virtual int isCPPinterface(); 238 virtual int isCPPinterface();
231 #endif 239 #endif
232 int isAbstract(); 240 int isAbstract();
233 virtual int vtblOffset(); 241 virtual int vtblOffset();
234 char *kind(); 242 const char *kind();
235 char *mangle(); 243 char *mangle();
236 void toDocBuffer(OutBuffer *buf); 244 void toDocBuffer(OutBuffer *buf);
237 245
238 PROT getAccess(Dsymbol *smember); // determine access to smember 246 PROT getAccess(Dsymbol *smember); // determine access to smember
239 247
240 void addLocalClass(ClassDeclarations *); 248 void addLocalClass(ClassDeclarations *);
241 249
242 // Back end 250 // Back end
243 void toObjFile(); // compile to .obj file 251 void toObjFile(int multiobj); // compile to .obj file
244 void toDebug(); 252 void toDebug();
245 unsigned baseVtblOffset(BaseClass *bc); 253 unsigned baseVtblOffset(BaseClass *bc);
246 Symbol *toSymbol(); 254 Symbol *toSymbol();
247 Symbol *toVtblSymbol(); 255 Symbol *toVtblSymbol();
248 void toDt(dt_t **pdt); 256 void toDt(dt_t **pdt);
256 ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; } 264 ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; }
257 }; 265 };
258 266
259 struct InterfaceDeclaration : ClassDeclaration 267 struct InterfaceDeclaration : ClassDeclaration
260 { 268 {
261 #if V2 269 #if DMDV2
262 int cpp; // !=0 if this is a C++ interface 270 int cpp; // !=0 if this is a C++ interface
263 #endif 271 #endif
264 InterfaceDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses); 272 InterfaceDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
265 Dsymbol *syntaxCopy(Dsymbol *s); 273 Dsymbol *syntaxCopy(Dsymbol *s);
266 void semantic(Scope *sc); 274 void semantic(Scope *sc);
267 int isBaseOf(ClassDeclaration *cd, int *poffset); 275 int isBaseOf(ClassDeclaration *cd, int *poffset);
268 int isBaseOf(BaseClass *bc, int *poffset); 276 int isBaseOf(BaseClass *bc, int *poffset);
269 char *kind(); 277 const char *kind();
270 int vtblOffset(); 278 int vtblOffset();
271 #if V2 279 #if DMDV2
272 int isCPPinterface(); 280 int isCPPinterface();
273 #endif 281 #endif
274 virtual int isCOMinterface(); 282 virtual int isCOMinterface();
275 283
276 void toObjFile(); // compile to .obj file 284 void toObjFile(int multiobj); // compile to .obj file
277 Symbol *toSymbol(); 285 Symbol *toSymbol();
278 286
279 InterfaceDeclaration *isInterfaceDeclaration() { return this; } 287 InterfaceDeclaration *isInterfaceDeclaration() { return this; }
280 }; 288 };
281 289