comparison dmd/declaration.h @ 159:5acec6b2eef8 trunk

[svn r175] merged dmd 1.029
author ChristianK
date Thu, 01 May 2008 15:15:28 +0200
parents ccd07d9f2ce9
children 2b72433d5c8c
comparison
equal deleted inserted replaced
158:287540c5f05e 159:5acec6b2eef8
1 1
2 // Compiler implementation of the D programming language 2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2007 by Digital Mars 3 // Copyright (c) 1999-2008 by Digital Mars
4 // All Rights Reserved 4 // All Rights Reserved
5 // written by Walter Bright 5 // written by Walter Bright
6 // http://www.digitalmars.com 6 // http://www.digitalmars.com
7 // License for redistribution is by either the Artistic License 7 // License for redistribution is by either the Artistic License
8 // in artistic.txt, or the GNU General Public License in gnu.txt. 8 // in artistic.txt, or the GNU General Public License in gnu.txt.
31 struct FuncDeclaration; 31 struct FuncDeclaration;
32 struct ExpInitializer; 32 struct ExpInitializer;
33 struct StructDeclaration; 33 struct StructDeclaration;
34 struct TupleType; 34 struct TupleType;
35 struct InterState; 35 struct InterState;
36 struct IRState;
36 37
37 enum PROT; 38 enum PROT;
38 enum LINK; 39 enum LINK;
39 enum TOK; 40 enum TOK;
40 enum MATCH; 41 enum MATCH;
62 STCctorinit = 0x20000, // can only be set inside constructor 63 STCctorinit = 0x20000, // can only be set inside constructor
63 STCtemplateparameter = 0x40000, // template parameter 64 STCtemplateparameter = 0x40000, // template parameter
64 STCscope = 0x80000, // template parameter 65 STCscope = 0x80000, // template parameter
65 STCinvariant = 0x100000, 66 STCinvariant = 0x100000,
66 STCref = 0x200000, 67 STCref = 0x200000,
68 STCinit = 0x400000, // has explicit initializer
69 STCmanifest = 0x800000, // manifest constant
70 STCnodtor = 0x1000000, // don't run destructor
71 STCnothrow = 0x2000000, // never throws exceptions
72 STCpure = 0x4000000, // pure function
73 STCtls = 0x8000000, // thread local
67 }; 74 };
68 75
69 struct Match 76 struct Match
70 { 77 {
71 int count; // number of matches found 78 int count; // number of matches found
92 99
93 Declaration(Identifier *id); 100 Declaration(Identifier *id);
94 void semantic(Scope *sc); 101 void semantic(Scope *sc);
95 char *kind(); 102 char *kind();
96 unsigned size(Loc loc); 103 unsigned size(Loc loc);
104 void checkModify(Loc loc, Scope *sc, Type *t);
97 105
98 void emitComment(Scope *sc); 106 void emitComment(Scope *sc);
99 void toDocBuffer(OutBuffer *buf); 107 void toDocBuffer(OutBuffer *buf);
100 108
101 char *mangle(); 109 char *mangle();
123 131
124 enum PROT prot(); 132 enum PROT prot();
125 133
126 Declaration *isDeclaration() { return this; } 134 Declaration *isDeclaration() { return this; }
127 135
136 // llvm
128 virtual void toObjFile(); // compile to .obj file 137 virtual void toObjFile(); // compile to .obj file
129 }; 138 };
130 139
131 /**************************************************************/ 140 /**************************************************************/
132 141
515 int inlineAsm; // !=0 if has inline assembler 524 int inlineAsm; // !=0 if has inline assembler
516 ILS inlineStatus; 525 ILS inlineStatus;
517 int inlineNest; // !=0 if nested inline 526 int inlineNest; // !=0 if nested inline
518 int cantInterpret; // !=0 if cannot interpret function 527 int cantInterpret; // !=0 if cannot interpret function
519 int semanticRun; // !=0 if semantic3() had been run 528 int semanticRun; // !=0 if semantic3() had been run
529 // this function's frame ptr
520 ForeachStatement *fes; // if foreach body, this is the foreach 530 ForeachStatement *fes; // if foreach body, this is the foreach
521 int introducing; // !=0 if 'introducing' function 531 int introducing; // !=0 if 'introducing' function
522 Type *tintro; // if !=NULL, then this is the type 532 Type *tintro; // if !=NULL, then this is the type
523 // of the 'introducing' function 533 // of the 'introducing' function
524 // this one is overriding 534 // this one is overriding
525 int inferRetType; // !=0 if return type is to be inferred 535 int inferRetType; // !=0 if return type is to be inferred
526 Scope *scope; // !=NULL means context to use 536 Scope *scope; // !=NULL means context to use
527 537
528 // Things that should really go into Scope 538 // Things that should really go into Scope
529 int hasReturnExp; // 1 if there's a return exp; statement 539 int hasReturnExp; // 1 if there's a return exp; statement
530 // 2 if there's a throw statement 540 // 2 if there's a throw statement
531 // 4 if there's an assert(0) 541 // 4 if there's an assert(0)
556 void semantic2(Scope *sc); 566 void semantic2(Scope *sc);
557 void semantic3(Scope *sc); 567 void semantic3(Scope *sc);
558 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 568 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
559 void bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs); 569 void bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs);
560 int overrides(FuncDeclaration *fd); 570 int overrides(FuncDeclaration *fd);
571 int findVtblIndex(Array *vtbl, int dim);
561 int overloadInsert(Dsymbol *s); 572 int overloadInsert(Dsymbol *s);
562 FuncDeclaration *overloadExactMatch(Type *t); 573 FuncDeclaration *overloadExactMatch(Type *t);
563 FuncDeclaration *overloadResolve(Loc loc, Expressions *arguments); 574 FuncDeclaration *overloadResolve(Loc loc, Expressions *arguments);
564 LabelDsymbol *searchLabel(Identifier *ident); 575 LabelDsymbol *searchLabel(Identifier *ident);
565 AggregateDeclaration *isThis(); 576 AggregateDeclaration *isThis();
646 }; 657 };
647 658
648 struct DtorDeclaration : FuncDeclaration 659 struct DtorDeclaration : FuncDeclaration
649 { 660 {
650 DtorDeclaration(Loc loc, Loc endloc); 661 DtorDeclaration(Loc loc, Loc endloc);
662 DtorDeclaration(Loc loc, Loc endloc, Identifier *id);
651 Dsymbol *syntaxCopy(Dsymbol *); 663 Dsymbol *syntaxCopy(Dsymbol *);
652 void semantic(Scope *sc); 664 void semantic(Scope *sc);
653 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 665 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
654 int isVirtual(); 666 int isVirtual();
655 int addPreInvariant(); 667 int addPreInvariant();