Mercurial > projects > ldc
comparison dmd2/declaration.h @ 1577:e4f7b5d9c68a
DMD 2.032 Merge.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Tue, 08 Sep 2009 10:07:56 +0100 |
parents | 54b3c1394d62 |
children |
comparison
equal
deleted
inserted
replaced
1576:4551475bc6b6 | 1577:e4f7b5d9c68a |
---|---|
259 struct VarDeclaration : Declaration | 259 struct VarDeclaration : Declaration |
260 { | 260 { |
261 Initializer *init; | 261 Initializer *init; |
262 unsigned offset; | 262 unsigned offset; |
263 int noauto; // no auto semantics | 263 int noauto; // no auto semantics |
264 #if DMDV2 | |
264 FuncDeclarations nestedrefs; // referenced by these lexically nested functions | 265 FuncDeclarations nestedrefs; // referenced by these lexically nested functions |
266 #else | |
267 int nestedref; // referenced by a lexically nested function | |
268 #endif | |
265 int ctorinit; // it has been initialized in a ctor | 269 int ctorinit; // it has been initialized in a ctor |
266 int onstack; // 1: it has been allocated on the stack | 270 int onstack; // 1: it has been allocated on the stack |
267 // 2: on stack, run destructor anyway | 271 // 2: on stack, run destructor anyway |
268 int canassign; // it can be assigned to | 272 int canassign; // it can be assigned to |
269 Dsymbol *aliassym; // if redone as alias to another symbol | 273 Dsymbol *aliassym; // if redone as alias to another symbol |
270 Expression *value; // when interpreting, this is the value | 274 Expression *value; // when interpreting, this is the value |
271 // (NULL if value not determinable) | 275 // (NULL if value not determinable) |
276 #if DMDV2 | |
277 VarDeclaration *rundtor; // if !NULL, rundtor is tested at runtime to see | |
278 // if the destructor should be run. Used to prevent | |
279 // dtor calls on postblitted vars | |
280 #endif | |
272 | 281 |
273 VarDeclaration(Loc loc, Type *t, Identifier *id, Initializer *init); | 282 VarDeclaration(Loc loc, Type *t, Identifier *id, Initializer *init); |
274 Dsymbol *syntaxCopy(Dsymbol *); | 283 Dsymbol *syntaxCopy(Dsymbol *); |
275 void semantic(Scope *sc); | 284 void semantic(Scope *sc); |
276 void semantic2(Scope *sc); | 285 void semantic2(Scope *sc); |
283 int needThis(); | 292 int needThis(); |
284 int isImportedSymbol(); | 293 int isImportedSymbol(); |
285 int isDataseg(); | 294 int isDataseg(); |
286 int isThreadlocal(); | 295 int isThreadlocal(); |
287 int hasPointers(); | 296 int hasPointers(); |
297 #if DMDV2 | |
288 int canTakeAddressOf(); | 298 int canTakeAddressOf(); |
289 int needsAutoDtor(); | 299 int needsAutoDtor(); |
300 #endif | |
290 Expression *callAutoDtor(Scope *sc); | 301 Expression *callAutoDtor(Scope *sc); |
291 ExpInitializer *getExpInitializer(); | 302 ExpInitializer *getExpInitializer(); |
292 Expression *getConstInitializer(); | 303 Expression *getConstInitializer(); |
293 void checkCtorConstInit(); | 304 void checkCtorConstInit(); |
294 void checkNestedReference(Scope *sc, Loc loc); | 305 void checkNestedReference(Scope *sc, Loc loc); |
623 BUILTINfabs, // std.math.fabs | 634 BUILTINfabs, // std.math.fabs |
624 }; | 635 }; |
625 | 636 |
626 Expression *eval_builtin(enum BUILTIN builtin, Expressions *arguments); | 637 Expression *eval_builtin(enum BUILTIN builtin, Expressions *arguments); |
627 | 638 |
639 #else | |
640 enum BUILTIN { }; | |
628 #endif | 641 #endif |
629 | 642 |
630 struct FuncDeclaration : Declaration | 643 struct FuncDeclaration : Declaration |
631 { | 644 { |
632 Array *fthrows; // Array of Type's of exceptions (not used) | 645 Array *fthrows; // Array of Type's of exceptions (not used) |
716 AggregateDeclaration *isMember2(); | 729 AggregateDeclaration *isMember2(); |
717 int getLevel(Loc loc, FuncDeclaration *fd); // lexical nesting level difference | 730 int getLevel(Loc loc, FuncDeclaration *fd); // lexical nesting level difference |
718 void appendExp(Expression *e); | 731 void appendExp(Expression *e); |
719 void appendState(Statement *s); | 732 void appendState(Statement *s); |
720 char *mangle(); | 733 char *mangle(); |
734 const char *toPrettyChars(); | |
721 int isMain(); | 735 int isMain(); |
722 int isWinMain(); | 736 int isWinMain(); |
723 int isDllMain(); | 737 int isDllMain(); |
724 enum BUILTIN isBuiltin(); | 738 enum BUILTIN isBuiltin(); |
725 int isExport(); | 739 int isExport(); |
732 int needThis(); | 746 int needThis(); |
733 virtual int isVirtual(); | 747 virtual int isVirtual(); |
734 virtual int isFinal(); | 748 virtual int isFinal(); |
735 virtual int addPreInvariant(); | 749 virtual int addPreInvariant(); |
736 virtual int addPostInvariant(); | 750 virtual int addPostInvariant(); |
737 Expression *interpret(InterState *istate, Expressions *arguments); | 751 Expression *interpret(InterState *istate, Expressions *arguments, Expression *thisexp = NULL); |
738 void inlineScan(); | 752 void inlineScan(); |
739 int canInline(int hasthis, int hdrscan = 0); | 753 int canInline(int hasthis, int hdrscan = 0); |
740 Expression *doInline(InlineScanState *iss, Expression *ethis, Array *arguments); | 754 Expression *doInline(InlineScanState *iss, Expression *ethis, Array *arguments); |
741 const char *kind(); | 755 const char *kind(); |
742 void toDocBuffer(OutBuffer *buf); | 756 void toDocBuffer(OutBuffer *buf); |
786 // true if overridden with the pragma(allow_inline); stmt | 800 // true if overridden with the pragma(allow_inline); stmt |
787 bool allowInlining; | 801 bool allowInlining; |
788 #endif | 802 #endif |
789 }; | 803 }; |
790 | 804 |
805 #if DMDV2 | |
791 FuncDeclaration *resolveFuncCall(Scope *sc, Loc loc, Dsymbol *s, | 806 FuncDeclaration *resolveFuncCall(Scope *sc, Loc loc, Dsymbol *s, |
792 Objects *tiargs, | 807 Objects *tiargs, |
793 Expression *ethis, | 808 Expression *ethis, |
794 Expressions *arguments, | 809 Expressions *arguments, |
795 int flags); | 810 int flags); |
796 | 811 #endif |
797 | 812 |
798 struct FuncAliasDeclaration : FuncDeclaration | 813 struct FuncAliasDeclaration : FuncDeclaration |
799 { | 814 { |
800 FuncDeclaration *funcalias; | 815 FuncDeclaration *funcalias; |
801 PROT importprot; // if generated by import, store its protection | 816 PROT importprot; // if generated by import, store its protection |