Mercurial > projects > ldc
diff dmd/dsymbol.h @ 1587:def7a1d494fd
Merge DMD 1.051
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 06 Nov 2009 23:58:01 +0100 |
parents | 229e02867307 |
children | 44b145be2ef5 |
line wrap: on
line diff
--- a/dmd/dsymbol.h Fri Nov 06 21:51:41 2009 +0100 +++ b/dmd/dsymbol.h Fri Nov 06 23:58:01 2009 +0100 @@ -1,6 +1,6 @@ // Compiler implementation of the D programming language -// Copyright (c) 1999-2008 by Digital Mars +// Copyright (c) 1999-2009 by Digital Mars // All Rights Reserved // written by Walter Bright // http://www.digitalmars.com @@ -28,6 +28,7 @@ struct Scope; struct DsymbolTable; struct Declaration; +struct ThisDeclaration; struct TupleDeclaration; struct TypedefDeclaration; struct AliasDeclaration; @@ -41,6 +42,7 @@ struct FuncAliasDeclaration; struct FuncLiteralDeclaration; struct CtorDeclaration; +struct PostBlitDeclaration; struct DtorDeclaration; struct StaticCtorDeclaration; struct StaticDtorDeclaration; @@ -70,11 +72,13 @@ struct HdrGenState; struct TypeInfoDeclaration; struct ClassInfoDeclaration; - +struct OverloadSet; +#if TARGET_NET +struct PragmaScope; +#endif #if IN_DMD struct Symbol; #endif - #if IN_GCC union tree_node; typedef union tree_node TYPE; @@ -82,6 +86,9 @@ struct TYPE; #endif +// Back end +struct Classsym; + #if IN_LLVM class Ir; class IrSymbol; @@ -114,11 +121,11 @@ #endif unsigned char *comment; // documentation comment for this Dsymbol Loc loc; // where defined + Scope *scope; // !=NULL means context to use for semantic() Dsymbol(); Dsymbol(Identifier *); char *toChars(); - char *toPrettyChars(); char *locToChars(); int equals(Object *o); int isAnonymous(); @@ -136,9 +143,12 @@ static Array *arraySyntaxCopy(Array *a); + virtual const char *toPrettyChars(); virtual const char *kind(); virtual Dsymbol *toAlias(); // resolve real symbol virtual int addMember(Scope *sc, ScopeDsymbol *s, int memnum); + virtual void setScope(Scope *sc); + virtual void importAll(Scope *sc); virtual void semantic(Scope *sc); virtual void semantic2(Scope *sc); virtual void semantic3(Scope *sc); @@ -152,6 +162,7 @@ #endif virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs); virtual void toDocBuffer(OutBuffer *buf); + virtual void toJsonBuffer(OutBuffer *buf); virtual unsigned size(Loc loc); virtual int isforwardRef(); virtual void defineRef(Dsymbol *s); @@ -160,6 +171,9 @@ virtual int isExport(); // is Dsymbol exported? virtual int isImportedSymbol(); // is Dsymbol imported? virtual int isDeprecated(); // is Dsymbol deprecated? +#if DMDV2 + virtual int isOverloadable(); +#endif virtual LabelDsymbol *isLabel(); // is this a LabelDsymbol? virtual AggregateDeclaration *isMember(); // is this symbol a member of an AggregateDeclaration? virtual Type *getType(); // is this a type? @@ -198,6 +212,7 @@ virtual TemplateInstance *isTemplateInstance() { return NULL; } virtual TemplateMixin *isTemplateMixin() { return NULL; } virtual Declaration *isDeclaration() { return NULL; } + virtual ThisDeclaration *isThisDeclaration() { return NULL; } virtual TupleDeclaration *isTupleDeclaration() { return NULL; } virtual TypedefDeclaration *isTypedefDeclaration() { return NULL; } virtual AliasDeclaration *isAliasDeclaration() { return NULL; } @@ -206,6 +221,7 @@ virtual FuncAliasDeclaration *isFuncAliasDeclaration() { return NULL; } virtual FuncLiteralDeclaration *isFuncLiteralDeclaration() { return NULL; } virtual CtorDeclaration *isCtorDeclaration() { return NULL; } + virtual PostBlitDeclaration *isPostBlitDeclaration() { return NULL; } virtual DtorDeclaration *isDtorDeclaration() { return NULL; } virtual StaticCtorDeclaration *isStaticCtorDeclaration() { return NULL; } virtual StaticDtorDeclaration *isStaticDtorDeclaration() { return NULL; } @@ -230,6 +246,11 @@ virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return NULL; } virtual ClassInfoDeclaration* isClassInfoDeclaration() { return NULL; } + virtual OverloadSet *isOverloadSet() { return NULL; } +#if TARGET_NET + virtual PragmaScope* isPragmaScope() { return NULL; } +#endif + #if IN_LLVM /// Codegen traversal virtual void codegen(Ir* ir); @@ -250,7 +271,7 @@ DsymbolTable *symtab; // members[] sorted into table Array *imports; // imported ScopeDsymbol's - unsigned char *prots; // PROT for each import + unsigned char *prots; // array of PROT, one for each import ScopeDsymbol(); ScopeDsymbol(Identifier *id); @@ -262,9 +283,14 @@ static void multiplyDefined(Loc loc, Dsymbol *s1, Dsymbol *s2); Dsymbol *nameCollision(Dsymbol *s); const char *kind(); + FuncDeclaration *findGetMembers(); + virtual Dsymbol *symtabInsert(Dsymbol *s); void emitMemberComments(Scope *sc); + static size_t dim(Array *members); + static Dsymbol *getNth(Array *members, size_t nth, size_t *pn = NULL); + ScopeDsymbol *isScopeDsymbol() { return this; } }; @@ -287,6 +313,7 @@ Expression *exp; // IndexExp or SliceExp TypeTuple *type; // for tuple[length] TupleDeclaration *td; // for tuples of objects + Scope *sc; ArrayScopeSymbol(Expression *e); ArrayScopeSymbol(TypeTuple *t); @@ -296,6 +323,20 @@ ArrayScopeSymbol *isArrayScopeSymbol() { return this; } }; +// Overload Sets + +#if DMDV2 +struct OverloadSet : Dsymbol +{ + Dsymbols a; // array of Dsymbols + + OverloadSet(); + void push(Dsymbol *s); + OverloadSet *isOverloadSet() { return this; } + const char *kind(); +}; +#endif + // Table of Dsymbol's struct DsymbolTable : Object