Mercurial > projects > ldc
annotate dmd/declaration.h @ 82:d8dd47ef3973 trunk
[svn r86] Changed the way arguments are given storage. It is now detected if they will need it during semantic passes.
Initial support for debug information. Very limited, but MUCH better than nothing :)
author | lindquist |
---|---|
date | Fri, 02 Nov 2007 01:17:26 +0100 |
parents | b706170e24a9 |
children | fd32135dca3e |
rev | line source |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | |
3 // Copyright (c) 1999-2007 by Digital Mars | |
4 // All Rights Reserved | |
5 // written by Walter Bright | |
6 // http://www.digitalmars.com | |
7 // License for redistribution is by either the Artistic License | |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | |
9 // See the included readme.txt for details. | |
10 | |
11 #ifndef DMD_DECLARATION_H | |
12 #define DMD_DECLARATION_H | |
13 | |
14 #ifdef __DMC__ | |
15 #pragma once | |
16 #endif /* __DMC__ */ | |
17 | |
50
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
18 #include <set> |
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
19 |
1 | 20 #include "dsymbol.h" |
21 #include "lexer.h" | |
22 #include "mtype.h" | |
23 | |
24 namespace llvm { | |
25 class Value; | |
26 } | |
27 | |
28 struct Expression; | |
29 struct Statement; | |
30 struct LabelDsymbol; | |
31 struct Initializer; | |
32 struct Module; | |
33 struct InlineScanState; | |
34 struct ForeachStatement; | |
35 struct FuncDeclaration; | |
36 struct ExpInitializer; | |
37 struct StructDeclaration; | |
38 struct TupleType; | |
39 struct InterState; | |
40 | |
41 enum PROT; | |
42 enum LINK; | |
43 enum TOK; | |
44 enum MATCH; | |
45 | |
46 enum STC | |
47 { | |
48 STCundefined = 0, | |
49 STCstatic = 1, | |
50 STCextern = 2, | |
51 STCconst = 4, | |
52 STCfinal = 8, | |
53 STCabstract = 0x10, | |
54 STCparameter = 0x20, | |
55 STCfield = 0x40, | |
56 STCoverride = 0x80, | |
57 STCauto = 0x100, | |
58 STCsynchronized = 0x200, | |
59 STCdeprecated = 0x400, | |
60 STCin = 0x800, // in parameter | |
61 STCout = 0x1000, // out parameter | |
62 STClazy = 0x2000, // lazy parameter | |
63 STCforeach = 0x4000, // variable for foreach loop | |
64 STCcomdat = 0x8000, // should go into COMDAT record | |
65 STCvariadic = 0x10000, // variadic function argument | |
66 STCctorinit = 0x20000, // can only be set inside constructor | |
67 STCtemplateparameter = 0x40000, // template parameter | |
68 STCscope = 0x80000, // template parameter | |
69 STCinvariant = 0x100000, | |
70 STCref = 0x200000, | |
71 }; | |
72 | |
73 struct Match | |
74 { | |
75 int count; // number of matches found | |
76 MATCH last; // match level of lastf | |
77 FuncDeclaration *lastf; // last matching function we found | |
78 FuncDeclaration *nextf; // current matching function | |
79 FuncDeclaration *anyf; // pick a func, any func, to use for error recovery | |
80 }; | |
81 | |
82 void overloadResolveX(Match *m, FuncDeclaration *f, Expressions *arguments); | |
83 int overloadApply(FuncDeclaration *fstart, | |
84 int (*fp)(void *, FuncDeclaration *), | |
85 void *param); | |
86 | |
87 /**************************************************************/ | |
88 | |
89 struct Declaration : Dsymbol | |
90 { | |
91 Type *type; | |
92 unsigned storage_class; | |
93 enum PROT protection; | |
94 enum LINK linkage; | |
95 | |
96 Declaration(Identifier *id); | |
97 void semantic(Scope *sc); | |
98 char *kind(); | |
99 unsigned size(Loc loc); | |
100 | |
101 void emitComment(Scope *sc); | |
102 void toDocBuffer(OutBuffer *buf); | |
103 | |
104 char *mangle(); | |
105 int isStatic() { return storage_class & STCstatic; } | |
106 virtual int isStaticConstructor(); | |
107 virtual int isStaticDestructor(); | |
108 virtual int isDelete(); | |
109 virtual int isDataseg(); | |
110 virtual int isCodeseg(); | |
111 int isCtorinit() { return storage_class & STCctorinit; } | |
112 int isFinal() { return storage_class & STCfinal; } | |
113 int isAbstract() { return storage_class & STCabstract; } | |
114 int isConst() { return storage_class & STCconst; } | |
115 int isAuto() { return storage_class & STCauto; } | |
116 int isScope() { return storage_class & (STCscope | STCauto); } | |
117 int isSynchronized() { return storage_class & STCsynchronized; } | |
118 int isParameter() { return storage_class & STCparameter; } | |
119 int isDeprecated() { return storage_class & STCdeprecated; } | |
120 int isOverride() { return storage_class & STCoverride; } | |
121 | |
122 int isIn() { return storage_class & STCin; } | |
123 int isOut() { return storage_class & STCout; } | |
124 int isRef() { return storage_class & STCref; } | |
125 | |
126 enum PROT prot(); | |
127 | |
128 Declaration *isDeclaration() { return this; } | |
129 | |
50
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
130 virtual void toObjFile(); // compile to .obj file |
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
131 |
40 | 132 bool llvmTouched; |
1 | 133 }; |
134 | |
135 /**************************************************************/ | |
136 | |
137 struct TupleDeclaration : Declaration | |
138 { | |
139 Objects *objects; | |
140 int isexp; // 1: expression tuple | |
141 | |
142 TypeTuple *tupletype; // !=NULL if this is a type tuple | |
143 | |
144 TupleDeclaration(Loc loc, Identifier *ident, Objects *objects); | |
145 Dsymbol *syntaxCopy(Dsymbol *); | |
146 char *kind(); | |
147 Type *getType(); | |
148 int needThis(); | |
149 | |
150 TupleDeclaration *isTupleDeclaration() { return this; } | |
151 }; | |
152 | |
153 /**************************************************************/ | |
154 | |
155 struct TypedefDeclaration : Declaration | |
156 { | |
157 Type *basetype; | |
158 Initializer *init; | |
159 int sem; // 0: semantic() has not been run | |
160 // 1: semantic() is in progress | |
161 // 2: semantic() has been run | |
162 // 3: semantic2() has been run | |
163 int inuse; // used to detect typedef cycles | |
164 | |
165 TypedefDeclaration(Loc loc, Identifier *ident, Type *basetype, Initializer *init); | |
166 Dsymbol *syntaxCopy(Dsymbol *); | |
167 void semantic(Scope *sc); | |
168 void semantic2(Scope *sc); | |
169 char *mangle(); | |
170 char *kind(); | |
171 Type *getType(); | |
172 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
173 #ifdef _DH | |
174 Type *htype; | |
175 Type *hbasetype; | |
176 #endif | |
177 | |
178 void toDocBuffer(OutBuffer *buf); | |
179 | |
180 void toObjFile(); // compile to .obj file | |
181 void toDebug(); | |
182 int cvMember(unsigned char *p); | |
183 | |
184 TypedefDeclaration *isTypedefDeclaration() { return this; } | |
185 | |
186 Symbol *sinit; | |
187 Symbol *toInitializer(); | |
188 }; | |
189 | |
190 /**************************************************************/ | |
191 | |
192 struct AliasDeclaration : Declaration | |
193 { | |
194 Dsymbol *aliassym; | |
195 Dsymbol *overnext; // next in overload list | |
196 int inSemantic; | |
197 | |
198 AliasDeclaration(Loc loc, Identifier *ident, Type *type); | |
199 AliasDeclaration(Loc loc, Identifier *ident, Dsymbol *s); | |
200 Dsymbol *syntaxCopy(Dsymbol *); | |
201 void semantic(Scope *sc); | |
202 int overloadInsert(Dsymbol *s); | |
203 char *kind(); | |
204 Type *getType(); | |
205 Dsymbol *toAlias(); | |
206 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
207 #ifdef _DH | |
208 Type *htype; | |
209 Dsymbol *haliassym; | |
210 #endif | |
211 | |
212 void toDocBuffer(OutBuffer *buf); | |
213 | |
214 AliasDeclaration *isAliasDeclaration() { return this; } | |
215 }; | |
216 | |
217 /**************************************************************/ | |
218 | |
219 struct VarDeclaration : Declaration | |
220 { | |
221 Initializer *init; | |
222 unsigned offset; | |
223 int noauto; // no auto semantics | |
224 int nestedref; // referenced by a lexically nested function | |
225 int inuse; | |
226 int ctorinit; // it has been initialized in a ctor | |
227 int onstack; // 1: it has been allocated on the stack | |
228 // 2: on stack, run destructor anyway | |
229 int canassign; // it can be assigned to | |
230 Dsymbol *aliassym; // if redone as alias to another symbol | |
231 Expression *value; // when interpreting, this is the value | |
232 // (NULL if value not determinable) | |
233 | |
234 VarDeclaration(Loc loc, Type *t, Identifier *id, Initializer *init); | |
235 Dsymbol *syntaxCopy(Dsymbol *); | |
236 void semantic(Scope *sc); | |
237 void semantic2(Scope *sc); | |
238 char *kind(); | |
239 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
240 #ifdef _DH | |
241 Type *htype; | |
242 Initializer *hinit; | |
243 #endif | |
244 int needThis(); | |
245 int isImportedSymbol(); | |
246 int isDataseg(); | |
247 int hasPointers(); | |
248 Expression *callAutoDtor(); | |
249 ExpInitializer *getExpInitializer(); | |
250 void checkCtorConstInit(); | |
251 void checkNestedReference(Scope *sc, Loc loc); | |
252 Dsymbol *toAlias(); | |
253 | |
254 Symbol *toSymbol(); | |
255 void toObjFile(); // compile to .obj file | |
256 int cvMember(unsigned char *p); | |
257 | |
258 // Eliminate need for dynamic_cast | |
259 VarDeclaration *isVarDeclaration() { return (VarDeclaration *)this; } | |
50
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
260 |
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
261 // LLVMDC |
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
262 int llvmNestedIndex; |
73 | 263 int llvmFieldIndex; |
264 size_t llvmFieldIndexOffset; | |
82
d8dd47ef3973
[svn r86] Changed the way arguments are given storage. It is now detected if they will need it during semantic passes.
lindquist
parents:
73
diff
changeset
|
265 bool llvmNeedsStorage; |
1 | 266 }; |
267 | |
268 /**************************************************************/ | |
269 | |
270 // This is a shell around a back end symbol | |
271 | |
272 struct SymbolDeclaration : Declaration | |
273 { | |
274 Symbol *sym; | |
275 StructDeclaration *dsym; | |
276 | |
277 SymbolDeclaration(Loc loc, Symbol *s, StructDeclaration *dsym); | |
278 | |
279 Symbol *toSymbol(); | |
280 | |
281 // Eliminate need for dynamic_cast | |
282 SymbolDeclaration *isSymbolDeclaration() { return (SymbolDeclaration *)this; } | |
283 }; | |
284 | |
285 struct ClassInfoDeclaration : VarDeclaration | |
286 { | |
287 ClassDeclaration *cd; | |
288 | |
289 ClassInfoDeclaration(ClassDeclaration *cd); | |
290 Dsymbol *syntaxCopy(Dsymbol *); | |
291 void semantic(Scope *sc); | |
292 | |
293 void emitComment(Scope *sc); | |
294 | |
295 Symbol *toSymbol(); | |
296 }; | |
297 | |
298 struct ModuleInfoDeclaration : VarDeclaration | |
299 { | |
300 Module *mod; | |
301 | |
302 ModuleInfoDeclaration(Module *mod); | |
303 Dsymbol *syntaxCopy(Dsymbol *); | |
304 void semantic(Scope *sc); | |
305 | |
306 void emitComment(Scope *sc); | |
307 | |
308 Symbol *toSymbol(); | |
309 }; | |
310 | |
311 struct TypeInfoDeclaration : VarDeclaration | |
312 { | |
313 Type *tinfo; | |
314 | |
315 TypeInfoDeclaration(Type *tinfo, int internal); | |
316 Dsymbol *syntaxCopy(Dsymbol *); | |
317 void semantic(Scope *sc); | |
318 | |
319 void emitComment(Scope *sc); | |
320 | |
321 Symbol *toSymbol(); | |
322 void toObjFile(); // compile to .obj file | |
323 virtual void toDt(dt_t **pdt); | |
324 | |
325 virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return this; } | |
326 }; | |
327 | |
328 struct TypeInfoStructDeclaration : TypeInfoDeclaration | |
329 { | |
330 TypeInfoStructDeclaration(Type *tinfo); | |
331 | |
332 void toDt(dt_t **pdt); | |
333 }; | |
334 | |
335 struct TypeInfoClassDeclaration : TypeInfoDeclaration | |
336 { | |
337 TypeInfoClassDeclaration(Type *tinfo); | |
338 | |
339 void toDt(dt_t **pdt); | |
340 }; | |
341 | |
342 struct TypeInfoInterfaceDeclaration : TypeInfoDeclaration | |
343 { | |
344 TypeInfoInterfaceDeclaration(Type *tinfo); | |
345 | |
346 void toDt(dt_t **pdt); | |
347 }; | |
348 | |
349 struct TypeInfoTypedefDeclaration : TypeInfoDeclaration | |
350 { | |
351 TypeInfoTypedefDeclaration(Type *tinfo); | |
352 | |
353 void toDt(dt_t **pdt); | |
354 }; | |
355 | |
356 struct TypeInfoPointerDeclaration : TypeInfoDeclaration | |
357 { | |
358 TypeInfoPointerDeclaration(Type *tinfo); | |
359 | |
360 void toDt(dt_t **pdt); | |
361 }; | |
362 | |
363 struct TypeInfoArrayDeclaration : TypeInfoDeclaration | |
364 { | |
365 TypeInfoArrayDeclaration(Type *tinfo); | |
366 | |
367 void toDt(dt_t **pdt); | |
368 }; | |
369 | |
370 struct TypeInfoStaticArrayDeclaration : TypeInfoDeclaration | |
371 { | |
372 TypeInfoStaticArrayDeclaration(Type *tinfo); | |
373 | |
374 void toDt(dt_t **pdt); | |
375 }; | |
376 | |
377 struct TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration | |
378 { | |
379 TypeInfoAssociativeArrayDeclaration(Type *tinfo); | |
380 | |
381 void toDt(dt_t **pdt); | |
382 }; | |
383 | |
384 struct TypeInfoEnumDeclaration : TypeInfoDeclaration | |
385 { | |
386 TypeInfoEnumDeclaration(Type *tinfo); | |
387 | |
388 void toDt(dt_t **pdt); | |
389 }; | |
390 | |
391 struct TypeInfoFunctionDeclaration : TypeInfoDeclaration | |
392 { | |
393 TypeInfoFunctionDeclaration(Type *tinfo); | |
394 | |
395 void toDt(dt_t **pdt); | |
396 }; | |
397 | |
398 struct TypeInfoDelegateDeclaration : TypeInfoDeclaration | |
399 { | |
400 TypeInfoDelegateDeclaration(Type *tinfo); | |
401 | |
402 void toDt(dt_t **pdt); | |
403 }; | |
404 | |
405 struct TypeInfoTupleDeclaration : TypeInfoDeclaration | |
406 { | |
407 TypeInfoTupleDeclaration(Type *tinfo); | |
408 | |
409 void toDt(dt_t **pdt); | |
410 }; | |
411 | |
412 struct ThisDeclaration : VarDeclaration | |
413 { | |
414 ThisDeclaration(Type *t); | |
415 Dsymbol *syntaxCopy(Dsymbol *); | |
416 }; | |
417 | |
418 enum ILS | |
419 { | |
420 ILSuninitialized, // not computed yet | |
421 ILSno, // cannot inline | |
422 ILSyes, // can inline | |
423 }; | |
424 | |
425 /**************************************************************/ | |
426 | |
427 struct FuncDeclaration : Declaration | |
428 { | |
429 Array *fthrows; // Array of Type's of exceptions (not used) | |
430 Statement *frequire; | |
431 Statement *fensure; | |
432 Statement *fbody; | |
433 | |
434 Identifier *outId; // identifier for out statement | |
435 VarDeclaration *vresult; // variable corresponding to outId | |
436 LabelDsymbol *returnLabel; // where the return goes | |
437 | |
438 DsymbolTable *localsymtab; // used to prevent symbols in different | |
439 // scopes from having the same name | |
440 VarDeclaration *vthis; // 'this' parameter (member and nested) | |
441 VarDeclaration *v_arguments; // '_arguments' parameter | |
442 #if IN_GCC | |
443 VarDeclaration *v_argptr; // '_argptr' variable | |
444 #endif | |
445 Dsymbols *parameters; // Array of VarDeclaration's for parameters | |
446 DsymbolTable *labtab; // statement label symbol table | |
447 Declaration *overnext; // next in overload list | |
448 Loc endloc; // location of closing curly bracket | |
449 int vtblIndex; // for member functions, index into vtbl[] | |
450 int naked; // !=0 if naked | |
451 int inlineAsm; // !=0 if has inline assembler | |
452 ILS inlineStatus; | |
453 int inlineNest; // !=0 if nested inline | |
454 int cantInterpret; // !=0 if cannot interpret function | |
455 int semanticRun; // !=0 if semantic3() had been run | |
456 int nestedFrameRef; // !=0 if nested variables referenced frame ptr | |
457 ForeachStatement *fes; // if foreach body, this is the foreach | |
458 int introducing; // !=0 if 'introducing' function | |
459 Type *tintro; // if !=NULL, then this is the type | |
460 // of the 'introducing' function | |
461 // this one is overriding | |
462 int inferRetType; // !=0 if return type is to be inferred | |
463 Scope *scope; // !=NULL means context to use | |
464 | |
465 // Things that should really go into Scope | |
466 int hasReturnExp; // 1 if there's a return exp; statement | |
467 // 2 if there's a throw statement | |
468 // 4 if there's an assert(0) | |
469 // 8 if there's inline asm | |
470 | |
471 // Support for NRVO (named return value optimization) | |
472 int nrvo_can; // !=0 means we can do it | |
473 VarDeclaration *nrvo_var; // variable to replace with shidden | |
474 Symbol *shidden; // hidden pointer passed to function | |
475 | |
476 FuncDeclaration(Loc loc, Loc endloc, Identifier *id, enum STC storage_class, Type *type); | |
477 Dsymbol *syntaxCopy(Dsymbol *); | |
478 void semantic(Scope *sc); | |
479 void semantic2(Scope *sc); | |
480 void semantic3(Scope *sc); | |
481 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
482 void bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
483 int overrides(FuncDeclaration *fd); | |
484 int overloadInsert(Dsymbol *s); | |
485 FuncDeclaration *overloadExactMatch(Type *t); | |
486 FuncDeclaration *overloadResolve(Loc loc, Expressions *arguments); | |
487 LabelDsymbol *searchLabel(Identifier *ident); | |
488 AggregateDeclaration *isThis(); | |
489 AggregateDeclaration *isMember2(); | |
490 int getLevel(Loc loc, FuncDeclaration *fd); // lexical nesting level difference | |
491 void appendExp(Expression *e); | |
492 void appendState(Statement *s); | |
493 char *mangle(); | |
494 int isMain(); | |
495 int isWinMain(); | |
496 int isDllMain(); | |
497 int isExport(); | |
498 int isImportedSymbol(); | |
499 int isAbstract(); | |
500 int isCodeseg(); | |
501 virtual int isNested(); | |
502 int needThis(); | |
503 virtual int isVirtual(); | |
504 virtual int addPreInvariant(); | |
505 virtual int addPostInvariant(); | |
506 Expression *interpret(InterState *istate, Expressions *arguments); | |
507 void inlineScan(); | |
508 int canInline(int hasthis, int hdrscan = 0); | |
509 Expression *doInline(InlineScanState *iss, Expression *ethis, Array *arguments); | |
510 char *kind(); | |
511 void toDocBuffer(OutBuffer *buf); | |
512 | |
513 static FuncDeclaration *genCfunc(Type *treturn, char *name); | |
514 static FuncDeclaration *genCfunc(Type *treturn, Identifier *id); | |
515 | |
516 Symbol *toSymbol(); | |
517 Symbol *toThunkSymbol(int offset); // thunk version | |
518 void toObjFile(); // compile to .obj file | |
519 int cvMember(unsigned char *p); | |
520 | |
521 FuncDeclaration *isFuncDeclaration() { return this; } | |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
9
diff
changeset
|
522 |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
9
diff
changeset
|
523 bool llvmQueued; |
15
37a4fdab33fc
[svn r19] * Added support for reassigning 'this' inside class constructors.
lindquist
parents:
11
diff
changeset
|
524 llvm::Value* llvmThisVar; |
50
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
525 std::set<VarDeclaration*> llvmNestedVars; |
6fcc08a4d406
[svn r54] Added support for nested delegates referencing parent's stack variables.
lindquist
parents:
40
diff
changeset
|
526 llvm::Value* llvmNested; |
57
a9d29e9f1fed
[svn r61] Added support for D-style variadic functions :)
lindquist
parents:
50
diff
changeset
|
527 llvm::Value* llvmArguments; |
a9d29e9f1fed
[svn r61] Added support for D-style variadic functions :)
lindquist
parents:
50
diff
changeset
|
528 llvm::Value* llvmArgPtr; |
82
d8dd47ef3973
[svn r86] Changed the way arguments are given storage. It is now detected if they will need it during semantic passes.
lindquist
parents:
73
diff
changeset
|
529 llvm::Constant* llvmDwarfSubProgram; |
1 | 530 }; |
531 | |
532 struct FuncAliasDeclaration : FuncDeclaration | |
533 { | |
534 FuncDeclaration *funcalias; | |
535 | |
536 FuncAliasDeclaration(FuncDeclaration *funcalias); | |
537 | |
538 FuncAliasDeclaration *isFuncAliasDeclaration() { return this; } | |
539 char *kind(); | |
540 Symbol *toSymbol(); | |
541 }; | |
542 | |
543 struct FuncLiteralDeclaration : FuncDeclaration | |
544 { | |
545 enum TOK tok; // TOKfunction or TOKdelegate | |
546 | |
547 FuncLiteralDeclaration(Loc loc, Loc endloc, Type *type, enum TOK tok, | |
548 ForeachStatement *fes); | |
549 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
550 Dsymbol *syntaxCopy(Dsymbol *); | |
551 int isNested(); | |
552 | |
553 FuncLiteralDeclaration *isFuncLiteralDeclaration() { return this; } | |
554 char *kind(); | |
555 }; | |
556 | |
557 struct CtorDeclaration : FuncDeclaration | |
558 { Arguments *arguments; | |
559 int varargs; | |
560 | |
561 CtorDeclaration(Loc loc, Loc endloc, Arguments *arguments, int varargs); | |
562 Dsymbol *syntaxCopy(Dsymbol *); | |
563 void semantic(Scope *sc); | |
564 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
565 char *kind(); | |
566 char *toChars(); | |
567 int isVirtual(); | |
568 int addPreInvariant(); | |
569 int addPostInvariant(); | |
570 void toDocBuffer(OutBuffer *buf); | |
571 | |
572 CtorDeclaration *isCtorDeclaration() { return this; } | |
573 }; | |
574 | |
575 struct DtorDeclaration : FuncDeclaration | |
576 { | |
577 DtorDeclaration(Loc loc, Loc endloc); | |
578 Dsymbol *syntaxCopy(Dsymbol *); | |
579 void semantic(Scope *sc); | |
580 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
581 int isVirtual(); | |
582 int addPreInvariant(); | |
583 int addPostInvariant(); | |
584 int overloadInsert(Dsymbol *s); | |
585 void emitComment(Scope *sc); | |
586 | |
587 DtorDeclaration *isDtorDeclaration() { return this; } | |
588 }; | |
589 | |
590 struct StaticCtorDeclaration : FuncDeclaration | |
591 { | |
592 StaticCtorDeclaration(Loc loc, Loc endloc); | |
593 Dsymbol *syntaxCopy(Dsymbol *); | |
594 void semantic(Scope *sc); | |
595 AggregateDeclaration *isThis(); | |
596 int isStaticConstructor(); | |
597 int isVirtual(); | |
598 int addPreInvariant(); | |
599 int addPostInvariant(); | |
600 void emitComment(Scope *sc); | |
601 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
602 | |
603 StaticCtorDeclaration *isStaticCtorDeclaration() { return this; } | |
604 }; | |
605 | |
606 struct StaticDtorDeclaration : FuncDeclaration | |
607 { | |
608 StaticDtorDeclaration(Loc loc, Loc endloc); | |
609 Dsymbol *syntaxCopy(Dsymbol *); | |
610 void semantic(Scope *sc); | |
611 AggregateDeclaration *isThis(); | |
612 int isStaticDestructor(); | |
613 int isVirtual(); | |
614 int addPreInvariant(); | |
615 int addPostInvariant(); | |
616 void emitComment(Scope *sc); | |
617 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
618 | |
619 StaticDtorDeclaration *isStaticDtorDeclaration() { return this; } | |
620 }; | |
621 | |
622 struct InvariantDeclaration : FuncDeclaration | |
623 { | |
624 InvariantDeclaration(Loc loc, Loc endloc); | |
625 Dsymbol *syntaxCopy(Dsymbol *); | |
626 void semantic(Scope *sc); | |
627 int isVirtual(); | |
628 int addPreInvariant(); | |
629 int addPostInvariant(); | |
630 void emitComment(Scope *sc); | |
631 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
632 | |
633 InvariantDeclaration *isInvariantDeclaration() { return this; } | |
634 }; | |
635 | |
636 | |
637 struct UnitTestDeclaration : FuncDeclaration | |
638 { | |
639 UnitTestDeclaration(Loc loc, Loc endloc); | |
640 Dsymbol *syntaxCopy(Dsymbol *); | |
641 void semantic(Scope *sc); | |
642 AggregateDeclaration *isThis(); | |
643 int isVirtual(); | |
644 int addPreInvariant(); | |
645 int addPostInvariant(); | |
646 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
647 | |
648 UnitTestDeclaration *isUnitTestDeclaration() { return this; } | |
649 }; | |
650 | |
651 struct NewDeclaration : FuncDeclaration | |
652 { Arguments *arguments; | |
653 int varargs; | |
654 | |
655 NewDeclaration(Loc loc, Loc endloc, Arguments *arguments, int varargs); | |
656 Dsymbol *syntaxCopy(Dsymbol *); | |
657 void semantic(Scope *sc); | |
658 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
659 char *kind(); | |
660 int isVirtual(); | |
661 int addPreInvariant(); | |
662 int addPostInvariant(); | |
663 | |
664 NewDeclaration *isNewDeclaration() { return this; } | |
665 }; | |
666 | |
667 | |
668 struct DeleteDeclaration : FuncDeclaration | |
669 { Arguments *arguments; | |
670 | |
671 DeleteDeclaration(Loc loc, Loc endloc, Arguments *arguments); | |
672 Dsymbol *syntaxCopy(Dsymbol *); | |
673 void semantic(Scope *sc); | |
674 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
675 char *kind(); | |
676 int isDelete(); | |
677 int isVirtual(); | |
678 int addPreInvariant(); | |
679 int addPostInvariant(); | |
680 #ifdef _DH | |
681 DeleteDeclaration *isDeleteDeclaration() { return this; } | |
682 #endif | |
683 }; | |
684 | |
685 #endif /* DMD_DECLARATION_H */ |