Mercurial > projects > ldc
diff dmd/declaration.h @ 1146:1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
* Added #if IN_DMD versioning around DMD backend specific code in the D1 frontend, D2 is currently broken.
* All part of a greater cleanup scheme.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Thu, 26 Mar 2009 20:45:53 +0100 |
parents | eeb8b95ea92e |
children | dbe4af57b240 |
line wrap: on
line diff
--- a/dmd/declaration.h Thu Mar 26 18:46:21 2009 +0100 +++ b/dmd/declaration.h Thu Mar 26 20:45:53 2009 +0100 @@ -191,13 +191,17 @@ void toDocBuffer(OutBuffer *buf); void toObjFile(int multiobj); // compile to .obj file +#if IN_DMD void toDebug(); int cvMember(unsigned char *p); +#endif TypedefDeclaration *isTypedefDeclaration() { return this; } +#if IN_DMD Symbol *sinit; Symbol *toInitializer(); +#endif }; /**************************************************************/ @@ -264,17 +268,21 @@ void checkNestedReference(Scope *sc, Loc loc); Dsymbol *toAlias(); + void toObjFile(int multiobj); // compile to .obj file +#if IN_DMD Symbol *toSymbol(); - void toObjFile(int multiobj); // compile to .obj file int cvMember(unsigned char *p); +#endif // Eliminate need for dynamic_cast VarDeclaration *isVarDeclaration() { return (VarDeclaration *)this; } +#if IN_LLVM // LDC AnonDeclaration* anonDecl; unsigned offset2; bool nakedUse; +#endif }; /**************************************************************/ @@ -287,7 +295,9 @@ StaticStructInitDeclaration(Loc loc, StructDeclaration *dsym); +#if IN_DMD Symbol *toSymbol(); +#endif // Eliminate need for dynamic_cast StaticStructInitDeclaration *isStaticStructInitDeclaration() { return (StaticStructInitDeclaration *)this; } @@ -303,7 +313,9 @@ void emitComment(Scope *sc); +#if IN_DMD Symbol *toSymbol(); +#endif ClassInfoDeclaration* isClassInfoDeclaration() { return this; } }; @@ -318,7 +330,9 @@ void emitComment(Scope *sc); +#if IN_DMD Symbol *toSymbol(); +#endif }; struct TypeInfoDeclaration : VarDeclaration @@ -331,147 +345,199 @@ void emitComment(Scope *sc); + void toObjFile(int multiobj); // compile to .obj file +#if IN_DMD Symbol *toSymbol(); - void toObjFile(int multiobj); // compile to .obj file virtual void toDt(dt_t **pdt); +#endif virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return this; } +#if IN_LLVM // LDC virtual void llvmDeclare(); virtual void llvmDefine(); +#endif }; struct TypeInfoStructDeclaration : TypeInfoDeclaration { TypeInfoStructDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoClassDeclaration : TypeInfoDeclaration { TypeInfoClassDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoInterfaceDeclaration : TypeInfoDeclaration { TypeInfoInterfaceDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoTypedefDeclaration : TypeInfoDeclaration { TypeInfoTypedefDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoPointerDeclaration : TypeInfoDeclaration { TypeInfoPointerDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoArrayDeclaration : TypeInfoDeclaration { TypeInfoArrayDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoStaticArrayDeclaration : TypeInfoDeclaration { TypeInfoStaticArrayDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration { TypeInfoAssociativeArrayDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoEnumDeclaration : TypeInfoDeclaration { TypeInfoEnumDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoFunctionDeclaration : TypeInfoDeclaration { TypeInfoFunctionDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoDelegateDeclaration : TypeInfoDeclaration { TypeInfoDelegateDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoTupleDeclaration : TypeInfoDeclaration { TypeInfoTupleDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; #if DMDV2 @@ -479,22 +545,30 @@ { TypeInfoConstDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; struct TypeInfoInvariantDeclaration : TypeInfoDeclaration { TypeInfoInvariantDeclaration(Type *tinfo); +#if IN_DMD void toDt(dt_t **pdt); +#endif +#if IN_LLVM // LDC void llvmDeclare(); void llvmDefine(); +#endif }; #endif @@ -578,7 +652,9 @@ // Support for NRVO (named return value optimization) int nrvo_can; // !=0 means we can do it VarDeclaration *nrvo_var; // variable to replace with shidden +#if IN_DMD Symbol *shidden; // hidden pointer passed to function +#endif #if DMDV2 enum BUILTIN builtin; // set if this is a known, builtin @@ -637,13 +713,18 @@ static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, const char *name); static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, Identifier *id); +#if IN_DMD Symbol *toSymbol(); Symbol *toThunkSymbol(int offset); // thunk version +#endif void toObjFile(int multiobj); // compile to .obj file +#if IN_DMD int cvMember(unsigned char *p); +#endif FuncDeclaration *isFuncDeclaration() { return this; } +#if IN_LLVM // LDC stuff // vars declared in this function that nested funcs reference @@ -666,6 +747,7 @@ // true if overridden with the pragma(allow_inline); stmt bool allowInlining; +#endif }; struct FuncAliasDeclaration : FuncDeclaration @@ -676,7 +758,9 @@ FuncAliasDeclaration *isFuncAliasDeclaration() { return this; } const char *kind(); +#if IN_DMD Symbol *toSymbol(); +#endif }; struct FuncLiteralDeclaration : FuncDeclaration