mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-11 05:16:19 +03:00
* 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.
This commit is contained in:
parent
367b8da8f4
commit
c42c90ea80
27 changed files with 283 additions and 638 deletions
|
@ -98,10 +98,12 @@ struct AggregateDeclaration : ScopeDsymbol
|
||||||
|
|
||||||
enum PROT prot();
|
enum PROT prot();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
// Back end
|
// Back end
|
||||||
Symbol *stag; // tag symbol for debug data
|
Symbol *stag; // tag symbol for debug data
|
||||||
Symbol *sinit;
|
Symbol *sinit;
|
||||||
Symbol *toInitializer();
|
Symbol *toInitializer();
|
||||||
|
#endif
|
||||||
|
|
||||||
AggregateDeclaration *isAggregateDeclaration() { return this; }
|
AggregateDeclaration *isAggregateDeclaration() { return this; }
|
||||||
};
|
};
|
||||||
|
@ -250,6 +252,7 @@ struct ClassDeclaration : AggregateDeclaration
|
||||||
|
|
||||||
// Back end
|
// Back end
|
||||||
void toObjFile(int multiobj); // compile to .obj file
|
void toObjFile(int multiobj); // compile to .obj file
|
||||||
|
#if IN_DMD
|
||||||
void toDebug();
|
void toDebug();
|
||||||
unsigned baseVtblOffset(BaseClass *bc);
|
unsigned baseVtblOffset(BaseClass *bc);
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
@ -258,6 +261,7 @@ struct ClassDeclaration : AggregateDeclaration
|
||||||
void toDt2(dt_t **pdt, ClassDeclaration *cd);
|
void toDt2(dt_t **pdt, ClassDeclaration *cd);
|
||||||
|
|
||||||
Symbol *vtblsym;
|
Symbol *vtblsym;
|
||||||
|
#endif
|
||||||
|
|
||||||
ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; }
|
ClassDeclaration *isClassDeclaration() { return (ClassDeclaration *)this; }
|
||||||
};
|
};
|
||||||
|
@ -280,7 +284,9 @@ struct InterfaceDeclaration : ClassDeclaration
|
||||||
virtual int isCOMinterface();
|
virtual int isCOMinterface();
|
||||||
|
|
||||||
void toObjFile(int multiobj); // compile to .obj file
|
void toObjFile(int multiobj); // compile to .obj file
|
||||||
|
#if IN_DMD
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
|
|
||||||
InterfaceDeclaration *isInterfaceDeclaration() { return this; }
|
InterfaceDeclaration *isInterfaceDeclaration() { return this; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,19 +27,23 @@
|
||||||
#include "parse.h"
|
#include "parse.h"
|
||||||
#include "template.h"
|
#include "template.h"
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
#include "../gen/enums.h"
|
#include "../gen/enums.h"
|
||||||
|
|
||||||
|
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
|
||||||
static llvm::cl::opt<bool> ignoreUnsupportedPragmas("ignore",
|
static llvm::cl::opt<bool> ignoreUnsupportedPragmas("ignore",
|
||||||
llvm::cl::desc("Ignore unsupported pragmas"),
|
llvm::cl::desc("Ignore unsupported pragmas"),
|
||||||
llvm::cl::ZeroOrMore);
|
llvm::cl::ZeroOrMore);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern void obj_includelib(const char *name);
|
extern void obj_includelib(const char *name);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void obj_startaddress(Symbol *s);
|
void obj_startaddress(Symbol *s);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/********************************* AttribDeclaration ****************************/
|
/********************************* AttribDeclaration ****************************/
|
||||||
|
@ -180,6 +184,7 @@ void AttribDeclaration::toObjFile(int multiobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
int AttribDeclaration::cvMember(unsigned char *p)
|
int AttribDeclaration::cvMember(unsigned char *p)
|
||||||
{
|
{
|
||||||
int nwritten = 0;
|
int nwritten = 0;
|
||||||
|
@ -198,6 +203,7 @@ int AttribDeclaration::cvMember(unsigned char *p)
|
||||||
}
|
}
|
||||||
return nwritten;
|
return nwritten;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int AttribDeclaration::hasPointers()
|
int AttribDeclaration::hasPointers()
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,9 @@ ClassDeclaration::ClassDeclaration(Loc loc, Identifier *id, BaseClasses *basecla
|
||||||
staticCtor = NULL;
|
staticCtor = NULL;
|
||||||
staticDtor = NULL;
|
staticDtor = NULL;
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
vtblsym = NULL;
|
vtblsym = NULL;
|
||||||
|
#endif
|
||||||
vclassinfo = NULL;
|
vclassinfo = NULL;
|
||||||
|
|
||||||
if (id)
|
if (id)
|
||||||
|
|
|
@ -255,7 +255,9 @@ TypedefDeclaration::TypedefDeclaration(Loc loc, Identifier *id, Type *basetype,
|
||||||
this->sem = 0;
|
this->sem = 0;
|
||||||
this->inuse = 0;
|
this->inuse = 0;
|
||||||
this->loc = loc;
|
this->loc = loc;
|
||||||
|
#if IN_DMD
|
||||||
this->sinit = NULL;
|
this->sinit = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Dsymbol *TypedefDeclaration::syntaxCopy(Dsymbol *s)
|
Dsymbol *TypedefDeclaration::syntaxCopy(Dsymbol *s)
|
||||||
|
|
|
@ -191,13 +191,17 @@ struct TypedefDeclaration : Declaration
|
||||||
void toDocBuffer(OutBuffer *buf);
|
void toDocBuffer(OutBuffer *buf);
|
||||||
|
|
||||||
void toObjFile(int multiobj); // compile to .obj file
|
void toObjFile(int multiobj); // compile to .obj file
|
||||||
|
#if IN_DMD
|
||||||
void toDebug();
|
void toDebug();
|
||||||
int cvMember(unsigned char *p);
|
int cvMember(unsigned char *p);
|
||||||
|
#endif
|
||||||
|
|
||||||
TypedefDeclaration *isTypedefDeclaration() { return this; }
|
TypedefDeclaration *isTypedefDeclaration() { return this; }
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
Symbol *sinit;
|
Symbol *sinit;
|
||||||
Symbol *toInitializer();
|
Symbol *toInitializer();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
@ -264,17 +268,21 @@ struct VarDeclaration : Declaration
|
||||||
void checkNestedReference(Scope *sc, Loc loc);
|
void checkNestedReference(Scope *sc, Loc loc);
|
||||||
Dsymbol *toAlias();
|
Dsymbol *toAlias();
|
||||||
|
|
||||||
Symbol *toSymbol();
|
|
||||||
void toObjFile(int multiobj); // compile to .obj file
|
void toObjFile(int multiobj); // compile to .obj file
|
||||||
|
#if IN_DMD
|
||||||
|
Symbol *toSymbol();
|
||||||
int cvMember(unsigned char *p);
|
int cvMember(unsigned char *p);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Eliminate need for dynamic_cast
|
// Eliminate need for dynamic_cast
|
||||||
VarDeclaration *isVarDeclaration() { return (VarDeclaration *)this; }
|
VarDeclaration *isVarDeclaration() { return (VarDeclaration *)this; }
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
AnonDeclaration* anonDecl;
|
AnonDeclaration* anonDecl;
|
||||||
unsigned offset2;
|
unsigned offset2;
|
||||||
bool nakedUse;
|
bool nakedUse;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
@ -287,7 +295,9 @@ struct StaticStructInitDeclaration : Declaration
|
||||||
|
|
||||||
StaticStructInitDeclaration(Loc loc, StructDeclaration *dsym);
|
StaticStructInitDeclaration(Loc loc, StructDeclaration *dsym);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Eliminate need for dynamic_cast
|
// Eliminate need for dynamic_cast
|
||||||
StaticStructInitDeclaration *isStaticStructInitDeclaration() { return (StaticStructInitDeclaration *)this; }
|
StaticStructInitDeclaration *isStaticStructInitDeclaration() { return (StaticStructInitDeclaration *)this; }
|
||||||
|
@ -303,7 +313,9 @@ struct ClassInfoDeclaration : VarDeclaration
|
||||||
|
|
||||||
void emitComment(Scope *sc);
|
void emitComment(Scope *sc);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
|
|
||||||
ClassInfoDeclaration* isClassInfoDeclaration() { return this; }
|
ClassInfoDeclaration* isClassInfoDeclaration() { return this; }
|
||||||
};
|
};
|
||||||
|
@ -318,7 +330,9 @@ struct ModuleInfoDeclaration : VarDeclaration
|
||||||
|
|
||||||
void emitComment(Scope *sc);
|
void emitComment(Scope *sc);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoDeclaration : VarDeclaration
|
struct TypeInfoDeclaration : VarDeclaration
|
||||||
|
@ -331,147 +345,199 @@ struct TypeInfoDeclaration : VarDeclaration
|
||||||
|
|
||||||
void emitComment(Scope *sc);
|
void emitComment(Scope *sc);
|
||||||
|
|
||||||
Symbol *toSymbol();
|
|
||||||
void toObjFile(int multiobj); // compile to .obj file
|
void toObjFile(int multiobj); // compile to .obj file
|
||||||
|
#if IN_DMD
|
||||||
|
Symbol *toSymbol();
|
||||||
virtual void toDt(dt_t **pdt);
|
virtual void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return this; }
|
virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return this; }
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual void llvmDeclare();
|
virtual void llvmDeclare();
|
||||||
virtual void llvmDefine();
|
virtual void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoStructDeclaration : TypeInfoDeclaration
|
struct TypeInfoStructDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoStructDeclaration(Type *tinfo);
|
TypeInfoStructDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoClassDeclaration : TypeInfoDeclaration
|
struct TypeInfoClassDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoClassDeclaration(Type *tinfo);
|
TypeInfoClassDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoInterfaceDeclaration : TypeInfoDeclaration
|
struct TypeInfoInterfaceDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoInterfaceDeclaration(Type *tinfo);
|
TypeInfoInterfaceDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoTypedefDeclaration : TypeInfoDeclaration
|
struct TypeInfoTypedefDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoTypedefDeclaration(Type *tinfo);
|
TypeInfoTypedefDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoPointerDeclaration : TypeInfoDeclaration
|
struct TypeInfoPointerDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoPointerDeclaration(Type *tinfo);
|
TypeInfoPointerDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoArrayDeclaration : TypeInfoDeclaration
|
struct TypeInfoArrayDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoArrayDeclaration(Type *tinfo);
|
TypeInfoArrayDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
|
struct TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoStaticArrayDeclaration(Type *tinfo);
|
TypeInfoStaticArrayDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
|
struct TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoAssociativeArrayDeclaration(Type *tinfo);
|
TypeInfoAssociativeArrayDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoEnumDeclaration : TypeInfoDeclaration
|
struct TypeInfoEnumDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoEnumDeclaration(Type *tinfo);
|
TypeInfoEnumDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoFunctionDeclaration : TypeInfoDeclaration
|
struct TypeInfoFunctionDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoFunctionDeclaration(Type *tinfo);
|
TypeInfoFunctionDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoDelegateDeclaration : TypeInfoDeclaration
|
struct TypeInfoDelegateDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoDelegateDeclaration(Type *tinfo);
|
TypeInfoDelegateDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoTupleDeclaration : TypeInfoDeclaration
|
struct TypeInfoTupleDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoTupleDeclaration(Type *tinfo);
|
TypeInfoTupleDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#if DMDV2
|
#if DMDV2
|
||||||
|
@ -479,22 +545,30 @@ struct TypeInfoConstDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoConstDeclaration(Type *tinfo);
|
TypeInfoConstDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeInfoInvariantDeclaration : TypeInfoDeclaration
|
struct TypeInfoInvariantDeclaration : TypeInfoDeclaration
|
||||||
{
|
{
|
||||||
TypeInfoInvariantDeclaration(Type *tinfo);
|
TypeInfoInvariantDeclaration(Type *tinfo);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
void toDt(dt_t **pdt);
|
void toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
void llvmDeclare();
|
void llvmDeclare();
|
||||||
void llvmDefine();
|
void llvmDefine();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -578,7 +652,9 @@ struct FuncDeclaration : Declaration
|
||||||
// Support for NRVO (named return value optimization)
|
// Support for NRVO (named return value optimization)
|
||||||
int nrvo_can; // !=0 means we can do it
|
int nrvo_can; // !=0 means we can do it
|
||||||
VarDeclaration *nrvo_var; // variable to replace with shidden
|
VarDeclaration *nrvo_var; // variable to replace with shidden
|
||||||
|
#if IN_DMD
|
||||||
Symbol *shidden; // hidden pointer passed to function
|
Symbol *shidden; // hidden pointer passed to function
|
||||||
|
#endif
|
||||||
|
|
||||||
#if DMDV2
|
#if DMDV2
|
||||||
enum BUILTIN builtin; // set if this is a known, builtin
|
enum BUILTIN builtin; // set if this is a known, builtin
|
||||||
|
@ -637,13 +713,18 @@ struct FuncDeclaration : Declaration
|
||||||
static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, const char *name);
|
static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, const char *name);
|
||||||
static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, Identifier *id);
|
static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, Identifier *id);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
Symbol *toThunkSymbol(int offset); // thunk version
|
Symbol *toThunkSymbol(int offset); // thunk version
|
||||||
|
#endif
|
||||||
void toObjFile(int multiobj); // compile to .obj file
|
void toObjFile(int multiobj); // compile to .obj file
|
||||||
|
#if IN_DMD
|
||||||
int cvMember(unsigned char *p);
|
int cvMember(unsigned char *p);
|
||||||
|
#endif
|
||||||
|
|
||||||
FuncDeclaration *isFuncDeclaration() { return this; }
|
FuncDeclaration *isFuncDeclaration() { return this; }
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC stuff
|
// LDC stuff
|
||||||
|
|
||||||
// vars declared in this function that nested funcs reference
|
// vars declared in this function that nested funcs reference
|
||||||
|
@ -666,6 +747,7 @@ struct FuncDeclaration : Declaration
|
||||||
|
|
||||||
// true if overridden with the pragma(allow_inline); stmt
|
// true if overridden with the pragma(allow_inline); stmt
|
||||||
bool allowInlining;
|
bool allowInlining;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FuncAliasDeclaration : FuncDeclaration
|
struct FuncAliasDeclaration : FuncDeclaration
|
||||||
|
@ -676,7 +758,9 @@ struct FuncAliasDeclaration : FuncDeclaration
|
||||||
|
|
||||||
FuncAliasDeclaration *isFuncAliasDeclaration() { return this; }
|
FuncAliasDeclaration *isFuncAliasDeclaration() { return this; }
|
||||||
const char *kind();
|
const char *kind();
|
||||||
|
#if IN_DMD
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FuncLiteralDeclaration : FuncDeclaration
|
struct FuncLiteralDeclaration : FuncDeclaration
|
||||||
|
|
|
@ -39,12 +39,16 @@ Dsymbol::Dsymbol()
|
||||||
this->ident = NULL;
|
this->ident = NULL;
|
||||||
this->c_ident = NULL;
|
this->c_ident = NULL;
|
||||||
this->parent = NULL;
|
this->parent = NULL;
|
||||||
|
#if IN_DMD
|
||||||
this->csym = NULL;
|
this->csym = NULL;
|
||||||
this->isym = NULL;
|
this->isym = NULL;
|
||||||
|
#endif
|
||||||
this->loc = 0;
|
this->loc = 0;
|
||||||
this->comment = NULL;
|
this->comment = NULL;
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
this->llvmInternal = LLVMnone;
|
this->llvmInternal = LLVMnone;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Dsymbol::Dsymbol(Identifier *ident)
|
Dsymbol::Dsymbol(Identifier *ident)
|
||||||
|
@ -53,12 +57,16 @@ Dsymbol::Dsymbol(Identifier *ident)
|
||||||
this->ident = ident;
|
this->ident = ident;
|
||||||
this->c_ident = NULL;
|
this->c_ident = NULL;
|
||||||
this->parent = NULL;
|
this->parent = NULL;
|
||||||
|
#if IN_DMD
|
||||||
this->csym = NULL;
|
this->csym = NULL;
|
||||||
this->isym = NULL;
|
this->isym = NULL;
|
||||||
|
#endif
|
||||||
this->loc = 0;
|
this->loc = 0;
|
||||||
this->comment = NULL;
|
this->comment = NULL;
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
this->llvmInternal = LLVMnone;
|
this->llvmInternal = LLVMnone;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int Dsymbol::equals(Object *o)
|
int Dsymbol::equals(Object *o)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "arraytypes.h"
|
#include "arraytypes.h"
|
||||||
|
|
||||||
// llvm
|
// llvm
|
||||||
#include "../ir/irsymbol.h"
|
#include "../ir/irdsymbol.h"
|
||||||
|
|
||||||
struct Identifier;
|
struct Identifier;
|
||||||
struct Scope;
|
struct Scope;
|
||||||
|
@ -49,7 +49,6 @@ struct UnitTestDeclaration;
|
||||||
struct NewDeclaration;
|
struct NewDeclaration;
|
||||||
struct VarDeclaration;
|
struct VarDeclaration;
|
||||||
struct AttribDeclaration;
|
struct AttribDeclaration;
|
||||||
struct Symbol;
|
|
||||||
struct Package;
|
struct Package;
|
||||||
struct Module;
|
struct Module;
|
||||||
struct Import;
|
struct Import;
|
||||||
|
@ -72,6 +71,10 @@ struct HdrGenState;
|
||||||
struct TypeInfoDeclaration;
|
struct TypeInfoDeclaration;
|
||||||
struct ClassInfoDeclaration;
|
struct ClassInfoDeclaration;
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
|
struct Symbol;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if IN_GCC
|
#if IN_GCC
|
||||||
union tree_node;
|
union tree_node;
|
||||||
typedef union tree_node TYPE;
|
typedef union tree_node TYPE;
|
||||||
|
@ -104,8 +107,10 @@ struct Dsymbol : Object
|
||||||
Identifier *ident;
|
Identifier *ident;
|
||||||
Identifier *c_ident;
|
Identifier *c_ident;
|
||||||
Dsymbol *parent;
|
Dsymbol *parent;
|
||||||
|
#if IN_DMD
|
||||||
Symbol *csym; // symbol for code generator
|
Symbol *csym; // symbol for code generator
|
||||||
Symbol *isym; // import version of csym
|
Symbol *isym; // import version of csym
|
||||||
|
#endif
|
||||||
unsigned char *comment; // documentation comment for this Dsymbol
|
unsigned char *comment; // documentation comment for this Dsymbol
|
||||||
Loc loc; // where defined
|
Loc loc; // where defined
|
||||||
|
|
||||||
|
@ -171,16 +176,20 @@ struct Dsymbol : Object
|
||||||
virtual void emitComment(Scope *sc);
|
virtual void emitComment(Scope *sc);
|
||||||
void emitDitto(Scope *sc);
|
void emitDitto(Scope *sc);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
// Backend
|
// Backend
|
||||||
|
|
||||||
virtual Symbol *toSymbol(); // to backend symbol
|
virtual Symbol *toSymbol(); // to backend symbol
|
||||||
|
#endif
|
||||||
virtual void toObjFile(int multiobj); // compile to .obj file
|
virtual void toObjFile(int multiobj); // compile to .obj file
|
||||||
|
#if IN_DMD
|
||||||
virtual int cvMember(unsigned char *p); // emit cv debug info for member
|
virtual int cvMember(unsigned char *p); // emit cv debug info for member
|
||||||
|
|
||||||
Symbol *toImport(); // to backend import symbol
|
Symbol *toImport(); // to backend import symbol
|
||||||
static Symbol *toImport(Symbol *s); // to backend import symbol
|
static Symbol *toImport(Symbol *s); // to backend import symbol
|
||||||
|
|
||||||
Symbol *toSymbolX(const char *prefix, int sclass, TYPE *t, const char *suffix); // helper
|
Symbol *toSymbolX(const char *prefix, int sclass, TYPE *t, const char *suffix); // helper
|
||||||
|
#endif
|
||||||
|
|
||||||
// Eliminate need for dynamic_cast
|
// Eliminate need for dynamic_cast
|
||||||
virtual Package *isPackage() { return NULL; }
|
virtual Package *isPackage() { return NULL; }
|
||||||
|
@ -222,10 +231,12 @@ struct Dsymbol : Object
|
||||||
virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return NULL; }
|
virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return NULL; }
|
||||||
virtual ClassInfoDeclaration* isClassInfoDeclaration() { return NULL; }
|
virtual ClassInfoDeclaration* isClassInfoDeclaration() { return NULL; }
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// llvm stuff
|
// llvm stuff
|
||||||
int llvmInternal;
|
int llvmInternal;
|
||||||
|
|
||||||
IrDsymbol ir;
|
IrDsymbol ir;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Dsymbol that generates a scope
|
// Dsymbol that generates a scope
|
||||||
|
|
|
@ -27,7 +27,9 @@ EnumDeclaration::EnumDeclaration(Loc loc, Identifier *id, Type *memtype)
|
||||||
maxval = 0;
|
maxval = 0;
|
||||||
minval = 0;
|
minval = 0;
|
||||||
defaultval = 0;
|
defaultval = 0;
|
||||||
|
#if IN_DMD
|
||||||
sinit = NULL;
|
sinit = NULL;
|
||||||
|
#endif
|
||||||
isdeprecated = 0;
|
isdeprecated = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,10 @@ struct EnumDeclaration : ScopeDsymbol
|
||||||
void toDebug();
|
void toDebug();
|
||||||
int cvMember(unsigned char *p);
|
int cvMember(unsigned char *p);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
Symbol *sinit;
|
Symbol *sinit;
|
||||||
Symbol *toInitializer();
|
Symbol *toInitializer();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3075,7 +3075,9 @@ StructLiteralExp::StructLiteralExp(Loc loc, StructDeclaration *sd, Expressions *
|
||||||
{
|
{
|
||||||
this->sd = sd;
|
this->sd = sd;
|
||||||
this->elements = elements;
|
this->elements = elements;
|
||||||
|
#if IN_DMD
|
||||||
this->sym = NULL;
|
this->sym = NULL;
|
||||||
|
#endif
|
||||||
this->soffset = 0;
|
this->soffset = 0;
|
||||||
this->fillHoles = 1;
|
this->fillHoles = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,29 +42,32 @@ struct ClassDeclaration;
|
||||||
struct HdrGenState;
|
struct HdrGenState;
|
||||||
struct BinExp;
|
struct BinExp;
|
||||||
struct InterState;
|
struct InterState;
|
||||||
struct Symbol; // back end symbol
|
|
||||||
struct OverloadSet;
|
struct OverloadSet;
|
||||||
namespace llvm
|
|
||||||
{
|
|
||||||
class Constant;
|
|
||||||
class ConstantInt;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum TOK;
|
enum TOK;
|
||||||
|
|
||||||
// Back end
|
// Back end
|
||||||
struct IRState;
|
struct IRState;
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
struct dt_t;
|
struct dt_t;
|
||||||
|
struct elem;
|
||||||
|
struct Symbol; // back end symbol
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef IN_GCC
|
||||||
|
union tree_node; typedef union tree_node elem;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if IN_LLVM
|
#if IN_LLVM
|
||||||
struct DValue;
|
struct DValue;
|
||||||
typedef DValue elem;
|
typedef DValue elem;
|
||||||
#else
|
|
||||||
#ifdef IN_GCC
|
namespace llvm
|
||||||
union tree_node; typedef union tree_node elem;
|
{
|
||||||
#else
|
class Constant;
|
||||||
struct elem;
|
class ConstantInt;
|
||||||
#endif
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void initPrecedence();
|
void initPrecedence();
|
||||||
|
@ -159,9 +162,12 @@ struct Expression : Object
|
||||||
|
|
||||||
// Back end
|
// Back end
|
||||||
virtual elem *toElem(IRState *irs);
|
virtual elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
virtual dt_t **toDt(dt_t **pdt);
|
virtual dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IntegerExp : Expression
|
struct IntegerExp : Expression
|
||||||
|
@ -186,9 +192,12 @@ struct IntegerExp : Expression
|
||||||
void toMangleBuffer(OutBuffer *buf);
|
void toMangleBuffer(OutBuffer *buf);
|
||||||
Expression *toLvalue(Scope *sc, Expression *e);
|
Expression *toLvalue(Scope *sc, Expression *e);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RealExp : Expression
|
struct RealExp : Expression
|
||||||
|
@ -211,9 +220,12 @@ struct RealExp : Expression
|
||||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||||
void toMangleBuffer(OutBuffer *buf);
|
void toMangleBuffer(OutBuffer *buf);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ComplexExp : Expression
|
struct ComplexExp : Expression
|
||||||
|
@ -239,9 +251,12 @@ struct ComplexExp : Expression
|
||||||
OutBuffer hexp;
|
OutBuffer hexp;
|
||||||
#endif
|
#endif
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IdentifierExp : Expression
|
struct IdentifierExp : Expression
|
||||||
|
@ -318,9 +333,12 @@ struct NullExp : Expression
|
||||||
Expression *castTo(Scope *sc, Type *t);
|
Expression *castTo(Scope *sc, Type *t);
|
||||||
Expression *interpret(InterState *istate);
|
Expression *interpret(InterState *istate);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StringExp : Expression
|
struct StringExp : Expression
|
||||||
|
@ -348,9 +366,12 @@ struct StringExp : Expression
|
||||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||||
void toMangleBuffer(OutBuffer *buf);
|
void toMangleBuffer(OutBuffer *buf);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tuple
|
// Tuple
|
||||||
|
@ -397,13 +418,16 @@ struct ArrayLiteralExp : Expression
|
||||||
Expression *interpret(InterState *istate);
|
Expression *interpret(InterState *istate);
|
||||||
MATCH implicitConvTo(Type *t);
|
MATCH implicitConvTo(Type *t);
|
||||||
Expression *castTo(Scope *sc, Type *t);
|
Expression *castTo(Scope *sc, Type *t);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
|
// LDC
|
||||||
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
|
|
||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
Expression *inlineScan(InlineScanState *iss);
|
Expression *inlineScan(InlineScanState *iss);
|
||||||
// LDC
|
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AssocArrayLiteralExp : Expression
|
struct AssocArrayLiteralExp : Expression
|
||||||
|
@ -429,8 +453,10 @@ struct AssocArrayLiteralExp : Expression
|
||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
Expression *inlineScan(InlineScanState *iss);
|
Expression *inlineScan(InlineScanState *iss);
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StructLiteralExp : Expression
|
struct StructLiteralExp : Expression
|
||||||
|
@ -439,7 +465,9 @@ struct StructLiteralExp : Expression
|
||||||
Expressions *elements; // parallels sd->fields[] with
|
Expressions *elements; // parallels sd->fields[] with
|
||||||
// NULL entries for fields to skip
|
// NULL entries for fields to skip
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
Symbol *sym; // back end symbol to initialize with literal
|
Symbol *sym; // back end symbol to initialize with literal
|
||||||
|
#endif
|
||||||
size_t soffset; // offset from start of s
|
size_t soffset; // offset from start of s
|
||||||
int fillHoles; // fill alignment 'holes' with zero
|
int fillHoles; // fill alignment 'holes' with zero
|
||||||
|
|
||||||
|
@ -456,14 +484,18 @@ struct StructLiteralExp : Expression
|
||||||
void scanForNestedRef(Scope *sc);
|
void scanForNestedRef(Scope *sc);
|
||||||
Expression *optimize(int result);
|
Expression *optimize(int result);
|
||||||
Expression *interpret(InterState *istate);
|
Expression *interpret(InterState *istate);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
|
// LDC
|
||||||
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
Expression *toLvalue(Scope *sc, Expression *e);
|
Expression *toLvalue(Scope *sc, Expression *e);
|
||||||
|
|
||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
Expression *inlineScan(InlineScanState *iss);
|
Expression *inlineScan(InlineScanState *iss);
|
||||||
// LDC
|
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeDotIdExp : Expression
|
struct TypeDotIdExp : Expression
|
||||||
|
@ -570,7 +602,9 @@ struct SymOffExp : Expression
|
||||||
void scanForNestedRef(Scope *sc);
|
void scanForNestedRef(Scope *sc);
|
||||||
|
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Variable
|
// Variable
|
||||||
|
@ -591,14 +625,17 @@ struct VarExp : Expression
|
||||||
Expression *toLvalue(Scope *sc, Expression *e);
|
Expression *toLvalue(Scope *sc, Expression *e);
|
||||||
Expression *modifiableLvalue(Scope *sc, Expression *e);
|
Expression *modifiableLvalue(Scope *sc, Expression *e);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#elif IN_LLVM
|
||||||
|
// LDC
|
||||||
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
|
#endif
|
||||||
void scanForNestedRef(Scope *sc);
|
void scanForNestedRef(Scope *sc);
|
||||||
|
|
||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
//Expression *inlineScan(InlineScanState *iss);
|
//Expression *inlineScan(InlineScanState *iss);
|
||||||
// LDC
|
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if DMDV2
|
#if DMDV2
|
||||||
|
|
|
@ -76,11 +76,15 @@ FuncDeclaration::FuncDeclaration(Loc loc, Loc endloc, Identifier *id, enum STC s
|
||||||
hasReturnExp = 0;
|
hasReturnExp = 0;
|
||||||
nrvo_can = 1;
|
nrvo_can = 1;
|
||||||
nrvo_var = NULL;
|
nrvo_var = NULL;
|
||||||
|
#if IN_DMD
|
||||||
shidden = NULL;
|
shidden = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
isArrayOp = false;
|
isArrayOp = false;
|
||||||
allowInlining = false;
|
allowInlining = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Dsymbol *FuncDeclaration::syntaxCopy(Dsymbol *s)
|
Dsymbol *FuncDeclaration::syntaxCopy(Dsymbol *s)
|
||||||
|
|
10
dmd/init.h
10
dmd/init.h
|
@ -44,7 +44,9 @@ struct Initializer : Object
|
||||||
|
|
||||||
static Initializers *arraySyntaxCopy(Initializers *ai);
|
static Initializers *arraySyntaxCopy(Initializers *ai);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
virtual dt_t *toDt();
|
virtual dt_t *toDt();
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual VoidInitializer *isVoidInitializer() { return NULL; }
|
virtual VoidInitializer *isVoidInitializer() { return NULL; }
|
||||||
virtual StructInitializer *isStructInitializer() { return NULL; }
|
virtual StructInitializer *isStructInitializer() { return NULL; }
|
||||||
|
@ -62,7 +64,9 @@ struct VoidInitializer : Initializer
|
||||||
Expression *toExpression();
|
Expression *toExpression();
|
||||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
dt_t *toDt();
|
dt_t *toDt();
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual VoidInitializer *isVoidInitializer() { return this; }
|
virtual VoidInitializer *isVoidInitializer() { return this; }
|
||||||
};
|
};
|
||||||
|
@ -82,7 +86,9 @@ struct StructInitializer : Initializer
|
||||||
Expression *toExpression();
|
Expression *toExpression();
|
||||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
dt_t *toDt();
|
dt_t *toDt();
|
||||||
|
#endif
|
||||||
|
|
||||||
StructInitializer *isStructInitializer() { return this; }
|
StructInitializer *isStructInitializer() { return this; }
|
||||||
};
|
};
|
||||||
|
@ -104,8 +110,10 @@ struct ArrayInitializer : Initializer
|
||||||
Initializer *toAssocArrayInitializer();
|
Initializer *toAssocArrayInitializer();
|
||||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
dt_t *toDt();
|
dt_t *toDt();
|
||||||
dt_t *toDtBit(); // for bit arrays
|
dt_t *toDtBit(); // for bit arrays
|
||||||
|
#endif
|
||||||
|
|
||||||
ArrayInitializer *isArrayInitializer() { return this; }
|
ArrayInitializer *isArrayInitializer() { return this; }
|
||||||
};
|
};
|
||||||
|
@ -121,7 +129,9 @@ struct ExpInitializer : Initializer
|
||||||
Expression *toExpression();
|
Expression *toExpression();
|
||||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
dt_t *toDt();
|
dt_t *toDt();
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual ExpInitializer *isExpInitializer() { return this; }
|
virtual ExpInitializer *isExpInitializer() { return this; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -551,8 +551,10 @@ Expression *DeclarationExp::doInline(InlineDoState *ids)
|
||||||
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
|
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
|
||||||
*vto = *vd;
|
*vto = *vd;
|
||||||
vto->parent = ids->parent;
|
vto->parent = ids->parent;
|
||||||
|
#if IN_DMD
|
||||||
vto->csym = NULL;
|
vto->csym = NULL;
|
||||||
vto->isym = NULL;
|
vto->isym = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
ids->from.push(vd);
|
ids->from.push(vd);
|
||||||
ids->to.push(vto);
|
ids->to.push(vto);
|
||||||
|
@ -645,8 +647,10 @@ Expression *IndexExp::doInline(InlineDoState *ids)
|
||||||
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
|
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
|
||||||
*vto = *vd;
|
*vto = *vd;
|
||||||
vto->parent = ids->parent;
|
vto->parent = ids->parent;
|
||||||
|
#if IN_DMD
|
||||||
vto->csym = NULL;
|
vto->csym = NULL;
|
||||||
vto->isym = NULL;
|
vto->isym = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
ids->from.push(vd);
|
ids->from.push(vd);
|
||||||
ids->to.push(vto);
|
ids->to.push(vto);
|
||||||
|
@ -682,8 +686,10 @@ Expression *SliceExp::doInline(InlineDoState *ids)
|
||||||
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
|
vto = new VarDeclaration(vd->loc, vd->type, vd->ident, vd->init);
|
||||||
*vto = *vd;
|
*vto = *vd;
|
||||||
vto->parent = ids->parent;
|
vto->parent = ids->parent;
|
||||||
|
#if IN_DMD
|
||||||
vto->csym = NULL;
|
vto->csym = NULL;
|
||||||
vto->isym = NULL;
|
vto->isym = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
ids->from.push(vd);
|
ids->from.push(vd);
|
||||||
ids->to.push(vto);
|
ids->to.push(vto);
|
||||||
|
|
|
@ -97,6 +97,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
||||||
semanticdone = 0;
|
semanticdone = 0;
|
||||||
decldefs = NULL;
|
decldefs = NULL;
|
||||||
vmoduleinfo = NULL;
|
vmoduleinfo = NULL;
|
||||||
|
#if IN_DMD
|
||||||
massert = NULL;
|
massert = NULL;
|
||||||
marray = NULL;
|
marray = NULL;
|
||||||
sictor = NULL;
|
sictor = NULL;
|
||||||
|
@ -104,6 +105,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
||||||
sdtor = NULL;
|
sdtor = NULL;
|
||||||
stest = NULL;
|
stest = NULL;
|
||||||
sfilename = NULL;
|
sfilename = NULL;
|
||||||
|
#endif
|
||||||
root = 0;
|
root = 0;
|
||||||
importedFrom = NULL;
|
importedFrom = NULL;
|
||||||
srcfile = NULL;
|
srcfile = NULL;
|
||||||
|
@ -120,9 +122,11 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
||||||
|
|
||||||
macrotable = NULL;
|
macrotable = NULL;
|
||||||
escapetable = NULL;
|
escapetable = NULL;
|
||||||
|
#if IN_DMD
|
||||||
doppelganger = 0;
|
doppelganger = 0;
|
||||||
cov = NULL;
|
cov = NULL;
|
||||||
covb = NULL;
|
covb = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
srcfilename = FileName::defaultExt(filename, global.mars_ext);
|
srcfilename = FileName::defaultExt(filename, global.mars_ext);
|
||||||
if (!srcfilename->equalsExt(global.mars_ext) &&
|
if (!srcfilename->equalsExt(global.mars_ext) &&
|
||||||
|
|
|
@ -32,6 +32,7 @@ struct DValue;
|
||||||
typedef DValue elem;
|
typedef DValue elem;
|
||||||
namespace llvm { class Module; }
|
namespace llvm { class Module; }
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef IN_GCC
|
#ifdef IN_GCC
|
||||||
union tree_node; typedef union tree_node elem;
|
union tree_node; typedef union tree_node elem;
|
||||||
#else
|
#else
|
||||||
|
@ -147,7 +148,7 @@ struct Module : Package
|
||||||
int imports(Module *m);
|
int imports(Module *m);
|
||||||
|
|
||||||
// Back end
|
// Back end
|
||||||
|
#if IN_DMD
|
||||||
int doppelganger; // sub-module
|
int doppelganger; // sub-module
|
||||||
Symbol *cov; // private uint[] __coverage;
|
Symbol *cov; // private uint[] __coverage;
|
||||||
unsigned *covb; // bit array of valid code line numbers
|
unsigned *covb; // bit array of valid code line numbers
|
||||||
|
@ -171,6 +172,7 @@ struct Module : Package
|
||||||
elem *toEmodulename();
|
elem *toEmodulename();
|
||||||
|
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
void genmoduleinfo();
|
void genmoduleinfo();
|
||||||
|
|
||||||
// LDC
|
// LDC
|
||||||
|
|
|
@ -130,7 +130,9 @@ Type::Type(TY ty, Type *next)
|
||||||
this->rto = NULL;
|
this->rto = NULL;
|
||||||
this->arrayof = NULL;
|
this->arrayof = NULL;
|
||||||
this->vtinfo = NULL;
|
this->vtinfo = NULL;
|
||||||
|
#if IN_DMD
|
||||||
this->ctype = NULL;
|
this->ctype = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *Type::syntaxCopy()
|
Type *Type::syntaxCopy()
|
||||||
|
|
49
dmd/mtype.h
49
dmd/mtype.h
|
@ -21,10 +21,12 @@
|
||||||
#include "arraytypes.h"
|
#include "arraytypes.h"
|
||||||
#include "expression.h"
|
#include "expression.h"
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// llvm
|
// llvm
|
||||||
#include "../ir/irtype.h"
|
#include "../ir/irtype.h"
|
||||||
#include "../ir/irfuncty.h"
|
#include "../ir/irfuncty.h"
|
||||||
namespace llvm { class Type; }
|
namespace llvm { class Type; }
|
||||||
|
#endif
|
||||||
|
|
||||||
struct Scope;
|
struct Scope;
|
||||||
struct Identifier;
|
struct Identifier;
|
||||||
|
@ -48,10 +50,12 @@ struct Argument;
|
||||||
#if IN_GCC
|
#if IN_GCC
|
||||||
union tree_node; typedef union tree_node TYPE;
|
union tree_node; typedef union tree_node TYPE;
|
||||||
typedef TYPE type;
|
typedef TYPE type;
|
||||||
#else
|
|
||||||
typedef struct TYPE type;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
|
typedef struct TYPE type;
|
||||||
struct Symbol;
|
struct Symbol;
|
||||||
|
#endif
|
||||||
|
|
||||||
enum TY
|
enum TY
|
||||||
{
|
{
|
||||||
|
@ -126,7 +130,9 @@ struct Type : Object
|
||||||
Type *arrayof; // array of this type
|
Type *arrayof; // array of this type
|
||||||
TypeInfoDeclaration *vtinfo; // TypeInfo object for this Type
|
TypeInfoDeclaration *vtinfo; // TypeInfo object for this Type
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *ctype; // for back end
|
type *ctype; // for back end
|
||||||
|
#endif
|
||||||
|
|
||||||
#define tvoid basic[Tvoid]
|
#define tvoid basic[Tvoid]
|
||||||
#define tint8 basic[Tint8]
|
#define tint8 basic[Tint8]
|
||||||
|
@ -236,7 +242,9 @@ struct Type : Object
|
||||||
virtual unsigned memalign(unsigned salign);
|
virtual unsigned memalign(unsigned salign);
|
||||||
virtual Expression *defaultInit(Loc loc = 0);
|
virtual Expression *defaultInit(Loc loc = 0);
|
||||||
virtual int isZeroInit(); // if initializer is 0
|
virtual int isZeroInit(); // if initializer is 0
|
||||||
|
#if IN_DMD
|
||||||
virtual dt_t **toDt(dt_t **pdt);
|
virtual dt_t **toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
Identifier *getTypeInfoIdent(int internal);
|
Identifier *getTypeInfoIdent(int internal);
|
||||||
virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
||||||
virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps);
|
virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps);
|
||||||
|
@ -253,17 +261,21 @@ struct Type : Object
|
||||||
static void error(Loc loc, const char *format, ...);
|
static void error(Loc loc, const char *format, ...);
|
||||||
static void warning(Loc loc, const char *format, ...);
|
static void warning(Loc loc, const char *format, ...);
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
// For backend
|
// For backend
|
||||||
virtual unsigned totym();
|
virtual unsigned totym();
|
||||||
virtual type *toCtype();
|
virtual type *toCtype();
|
||||||
virtual type *toCParamtype();
|
virtual type *toCParamtype();
|
||||||
virtual Symbol *toSymbol();
|
virtual Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
|
|
||||||
// For eliminating dynamic_cast
|
// For eliminating dynamic_cast
|
||||||
virtual TypeBasic *isTypeBasic();
|
virtual TypeBasic *isTypeBasic();
|
||||||
|
|
||||||
|
#if IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
IrType ir;
|
IrType ir;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeBasic : Type
|
struct TypeBasic : Type
|
||||||
|
@ -322,15 +334,19 @@ struct TypeSArray : TypeArray
|
||||||
unsigned memalign(unsigned salign);
|
unsigned memalign(unsigned salign);
|
||||||
MATCH implicitConvTo(Type *to);
|
MATCH implicitConvTo(Type *to);
|
||||||
Expression *defaultInit(Loc loc);
|
Expression *defaultInit(Loc loc);
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
dt_t **toDtElem(dt_t **pdt, Expression *e);
|
dt_t **toDtElem(dt_t **pdt, Expression *e);
|
||||||
|
#endif
|
||||||
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
Expression *toExpression();
|
Expression *toExpression();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
type *toCParamtype();
|
type *toCParamtype();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Dynamic array, no dimension
|
// Dynamic array, no dimension
|
||||||
|
@ -353,7 +369,9 @@ struct TypeDArray : TypeArray
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeAArray : TypeArray
|
struct TypeAArray : TypeArray
|
||||||
|
@ -376,10 +394,12 @@ struct TypeAArray : TypeArray
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
// Back end
|
// Back end
|
||||||
Symbol *aaGetSymbol(const char *func, int flags);
|
Symbol *aaGetSymbol(const char *func, int flags);
|
||||||
|
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypePointer : Type
|
struct TypePointer : Type
|
||||||
|
@ -398,7 +418,9 @@ struct TypePointer : Type
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeReference : Type
|
struct TypeReference : Type
|
||||||
|
@ -438,13 +460,18 @@ struct TypeFunction : Type
|
||||||
Type *reliesOnTident();
|
Type *reliesOnTident();
|
||||||
|
|
||||||
int callMatch(Expressions *toargs);
|
int callMatch(Expressions *toargs);
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
#endif
|
||||||
|
|
||||||
enum RET retStyle();
|
enum RET retStyle();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
unsigned totym();
|
unsigned totym();
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
IrFuncTy fty;
|
IrFuncTy fty;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeDelegate : Type
|
struct TypeDelegate : Type
|
||||||
|
@ -462,7 +489,9 @@ struct TypeDelegate : Type
|
||||||
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
|
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeQualified : Type
|
struct TypeQualified : Type
|
||||||
|
@ -543,17 +572,21 @@ struct TypeStruct : Type
|
||||||
Expression *defaultInit(Loc loc);
|
Expression *defaultInit(Loc loc);
|
||||||
int isZeroInit();
|
int isZeroInit();
|
||||||
int checkBoolean();
|
int checkBoolean();
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
#elif IN_LLVM
|
||||||
// LDC
|
// LDC
|
||||||
// cache the hasUnalignedFields check
|
// cache the hasUnalignedFields check
|
||||||
// 0 = not checked, 1 = aligned, 2 = unaligned
|
// 0 = not checked, 1 = aligned, 2 = unaligned
|
||||||
int unaligned;
|
int unaligned;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeEnum : Type
|
struct TypeEnum : Type
|
||||||
|
@ -583,7 +616,9 @@ struct TypeEnum : Type
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeTypedef : Type
|
struct TypeTypedef : Type
|
||||||
|
@ -614,13 +649,17 @@ struct TypeTypedef : Type
|
||||||
MATCH implicitConvTo(Type *to);
|
MATCH implicitConvTo(Type *to);
|
||||||
Expression *defaultInit(Loc loc);
|
Expression *defaultInit(Loc loc);
|
||||||
int isZeroInit();
|
int isZeroInit();
|
||||||
|
#if IN_DMD
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
|
#endif
|
||||||
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
type *toCParamtype();
|
type *toCParamtype();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeClass : Type
|
struct TypeClass : Type
|
||||||
|
@ -647,9 +686,11 @@ struct TypeClass : Type
|
||||||
TypeInfoDeclaration *getTypeInfoDeclaration();
|
TypeInfoDeclaration *getTypeInfoDeclaration();
|
||||||
int hasPointers();
|
int hasPointers();
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
type *toCtype();
|
type *toCtype();
|
||||||
|
|
||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TypeTuple : Type
|
struct TypeTuple : Type
|
||||||
|
|
|
@ -41,8 +41,10 @@ AggregateDeclaration::AggregateDeclaration(Loc loc, Identifier *id)
|
||||||
aggNew = NULL;
|
aggNew = NULL;
|
||||||
aggDelete = NULL;
|
aggDelete = NULL;
|
||||||
|
|
||||||
|
#if IN_DMD
|
||||||
stag = NULL;
|
stag = NULL;
|
||||||
sinit = NULL;
|
sinit = NULL;
|
||||||
|
#endif
|
||||||
scope = NULL;
|
scope = NULL;
|
||||||
#if V2
|
#if V2
|
||||||
dtor = NULL;
|
dtor = NULL;
|
||||||
|
|
|
@ -363,14 +363,18 @@ void TemplateDeclaration::semantic(Scope *sc)
|
||||||
{
|
{
|
||||||
// Generate this function as it may be used
|
// Generate this function as it may be used
|
||||||
// when template is instantiated in other modules
|
// when template is instantiated in other modules
|
||||||
sc->module->toModuleArray();
|
|
||||||
|
// FIXME: LDC
|
||||||
|
//sc->module->toModuleArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/*global.params.useAssert &&*/ sc->module)
|
if (/*global.params.useAssert &&*/ sc->module)
|
||||||
{
|
{
|
||||||
// Generate this function as it may be used
|
// Generate this function as it may be used
|
||||||
// when template is instantiated in other modules
|
// when template is instantiated in other modules
|
||||||
sc->module->toModuleAssert();
|
|
||||||
|
// FIXME: LDC
|
||||||
|
//sc->module->toModuleAssert();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remember Scope for later instantiations, but make
|
/* Remember Scope for later instantiations, but make
|
||||||
|
|
208
gen/tocsym.cpp
208
gen/tocsym.cpp
|
@ -1,208 +0,0 @@
|
||||||
|
|
||||||
// Copyright (c) 1999-2005 by Digital Mars
|
|
||||||
// All Rights Reserved
|
|
||||||
// written by Walter Bright
|
|
||||||
// www.digitalmars.com
|
|
||||||
// License for redistribution is by either the Artistic License
|
|
||||||
// in artistic.txt, or the GNU General Public License in gnu.txt.
|
|
||||||
// See the included readme.txt for details.
|
|
||||||
|
|
||||||
// stubbed out for dmdfe. Original is in dmd/tocsym.c
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#include "mars.h"
|
|
||||||
#include "module.h"
|
|
||||||
#include "mtype.h"
|
|
||||||
#include "declaration.h"
|
|
||||||
#include "statement.h"
|
|
||||||
#include "enum.h"
|
|
||||||
#include "aggregate.h"
|
|
||||||
#include "init.h"
|
|
||||||
#include "attrib.h"
|
|
||||||
#include "lexer.h"
|
|
||||||
|
|
||||||
|
|
||||||
Symbol *StaticStructInitDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
* Helper
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *Dsymbol::toSymbolX(const char *prefix, int sclass, TYPE *t, const char *suffix)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *Dsymbol::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************
|
|
||||||
* Generate import symbol from symbol.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *Dsymbol::toImport()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *Dsymbol::toImport(Symbol *sym)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *VarDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *ClassInfoDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *ModuleInfoDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *TypeInfoDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *FuncDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *FuncDeclaration::toThunkSymbol(int offset)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *FuncAliasDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************
|
|
||||||
* Create a static symbol we can hang DT initializers onto.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *static_sym()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
* Create the "ClassInfo" symbol
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *ClassDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
* Create the "InterfaceInfo" symbol
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *InterfaceDeclaration::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
* Create the "ModuleInfo" symbol
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *Module::toSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
* This is accessible via the ClassData, but since it is frequently
|
|
||||||
* needed directly (like for rtti comparisons), make it directly accessible.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *ClassDeclaration::toVtblSymbol()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* Create the static initializer for the struct/class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *AggregateDeclaration::toInitializer()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *Module::toModuleAssert()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *Module::toModuleArray()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************
|
|
||||||
* Determine the right symbol to look up
|
|
||||||
* an associative array element.
|
|
||||||
* Input:
|
|
||||||
* flags 0 don't add value signature
|
|
||||||
* 1 add value signature
|
|
||||||
*/
|
|
||||||
|
|
||||||
Symbol *TypeAArray::aaGetSymbol(const char *func, int flags)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
140
gen/todt.cpp
140
gen/todt.cpp
|
@ -1,140 +0,0 @@
|
||||||
|
|
||||||
// Copyright (c) 1999-2005 by Digital Mars
|
|
||||||
// All Rights Reserved
|
|
||||||
// written by Walter Bright
|
|
||||||
// www.digitalmars.com
|
|
||||||
// License for redistribution is by either the Artistic License
|
|
||||||
// in artistic.txt, or the GNU General Public License in gnu.txt.
|
|
||||||
// See the included readme.txt for details.
|
|
||||||
|
|
||||||
// stubbed out for dmdfe. Original is in dmd/todt.c
|
|
||||||
|
|
||||||
#include "lexer.h"
|
|
||||||
#include "mtype.h"
|
|
||||||
#include "expression.h"
|
|
||||||
#include "init.h"
|
|
||||||
#include "enum.h"
|
|
||||||
#include "aggregate.h"
|
|
||||||
#include "declaration.h"
|
|
||||||
|
|
||||||
struct dt_t {};
|
|
||||||
|
|
||||||
dt_t *Initializer::toDt()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dt_t *StructInitializer::toDt()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dt_t *ArrayInitializer::toDt()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dt_t *ArrayInitializer::toDtBit()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dt_t *ExpInitializer::toDt()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t *VoidInitializer::toDt()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ================================================================ */
|
|
||||||
|
|
||||||
dt_t **Expression::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **IntegerExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **RealExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **ComplexExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **NullExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **StringExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **SymOffExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **VarExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **ArrayLiteralExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
dt_t **StructLiteralExp::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassDeclaration::toDt2(dt_t **pdt, ClassDeclaration *cd)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void StructDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **Type::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **TypeSArray::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **TypeStruct::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt_t **TypeTypedef::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
159
gen/toir.cpp
159
gen/toir.cpp
|
@ -2618,164 +2618,7 @@ CONSTSTUB(SliceExp);
|
||||||
CONSTSTUB(IndexExp);
|
CONSTSTUB(IndexExp);
|
||||||
CONSTSTUB(AssocArrayLiteralExp);
|
CONSTSTUB(AssocArrayLiteralExp);
|
||||||
|
|
||||||
unsigned Type::totym() { return 0; }
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
type * Type::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * Type::toCParamtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Symbol * Type::toSymbol()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type *
|
|
||||||
TypeTypedef::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type *
|
|
||||||
TypeTypedef::toCParamtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TypedefDeclaration::toDebug()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
type *
|
|
||||||
TypeEnum::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type *
|
|
||||||
TypeStruct::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
StructDeclaration::toDebug()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Symbol * TypeClass::toSymbol()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned TypeFunction::totym()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * TypeFunction::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * TypeSArray::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type *TypeSArray::toCParamtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * TypeDArray::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * TypeAArray::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * TypePointer::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * TypeDelegate::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
type * TypeClass::toCtype()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClassDeclaration::toDebug()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void
|
|
||||||
EnumDeclaration::toDebug()
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int Dsymbol::cvMember(unsigned char*)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int EnumDeclaration::cvMember(unsigned char*)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int FuncDeclaration::cvMember(unsigned char*)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int VarDeclaration::cvMember(unsigned char*)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int TypedefDeclaration::cvMember(unsigned char*)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void obj_includelib(const char* lib)
|
void obj_includelib(const char* lib)
|
||||||
{
|
{
|
||||||
|
|
|
@ -827,16 +827,6 @@ void ClassDeclaration::toObjFile(int multiobj)
|
||||||
gIR->resolveList.push_back(this);
|
gIR->resolveList.push_back(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************
|
|
||||||
* Get offset of base class's vtbl[] initializer from start of csym.
|
|
||||||
* Returns ~0 if not this csym.
|
|
||||||
*/
|
|
||||||
|
|
||||||
unsigned ClassDeclaration::baseVtblOffset(BaseClass *bc)
|
|
||||||
{
|
|
||||||
return ~0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ================================================================== */
|
/* ================================================================== */
|
||||||
|
|
||||||
void TupleDeclaration::toObjFile(int multiobj)
|
void TupleDeclaration::toObjFile(int multiobj)
|
||||||
|
|
101
gen/typinf.cpp
101
gen/typinf.cpp
|
@ -352,11 +352,6 @@ void DtoDefineTypeInfo(TypeInfoDeclaration* tid)
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0 && "TypeInfoDeclaration::toDt");
|
|
||||||
}
|
|
||||||
|
|
||||||
void TypeInfoDeclaration::llvmDeclare()
|
void TypeInfoDeclaration::llvmDeclare()
|
||||||
{
|
{
|
||||||
assert(0 && "TypeInfoDeclaration::llvmDeclare");
|
assert(0 && "TypeInfoDeclaration::llvmDeclare");
|
||||||
|
@ -438,11 +433,6 @@ void TypeInfoTypedefDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoTypedefDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoEnumDeclaration::llvmDeclare()
|
void TypeInfoEnumDeclaration::llvmDeclare()
|
||||||
|
@ -516,11 +506,6 @@ void TypeInfoEnumDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoEnumDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
static void LLVM_D_Declare_TypeInfoBase(TypeInfoDeclaration* tid, ClassDeclaration* cd)
|
static void LLVM_D_Declare_TypeInfoBase(TypeInfoDeclaration* tid, ClassDeclaration* cd)
|
||||||
|
@ -582,11 +567,6 @@ void TypeInfoPointerDeclaration::llvmDefine()
|
||||||
LLVM_D_Define_TypeInfoBase(tc->next, this, Type::typeinfopointer);
|
LLVM_D_Define_TypeInfoBase(tc->next, this, Type::typeinfopointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoPointerDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoArrayDeclaration::llvmDeclare()
|
void TypeInfoArrayDeclaration::llvmDeclare()
|
||||||
|
@ -611,16 +591,11 @@ void TypeInfoArrayDeclaration::llvmDefine()
|
||||||
LLVM_D_Define_TypeInfoBase(tc->next, this, Type::typeinfoarray);
|
LLVM_D_Define_TypeInfoBase(tc->next, this, Type::typeinfoarray);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoArrayDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoStaticArrayDeclaration::llvmDeclare()
|
void TypeInfoStaticArrayDeclaration::llvmDeclare()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoStaticArrayDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoStaticArrayDeclaration::llvmDeclare() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
// init typeinfo class
|
// init typeinfo class
|
||||||
|
@ -633,7 +608,7 @@ void TypeInfoStaticArrayDeclaration::llvmDeclare()
|
||||||
|
|
||||||
void TypeInfoStaticArrayDeclaration::llvmDefine()
|
void TypeInfoStaticArrayDeclaration::llvmDefine()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoStaticArrayDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoStaticArrayDeclaration::llvmDefine() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
// init typeinfo class
|
// init typeinfo class
|
||||||
|
@ -671,16 +646,11 @@ void TypeInfoStaticArrayDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoStaticArrayDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoAssociativeArrayDeclaration::llvmDeclare()
|
void TypeInfoAssociativeArrayDeclaration::llvmDeclare()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoAssociativeArrayDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoAssociativeArrayDeclaration::llvmDeclare() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
// init typeinfo class
|
// init typeinfo class
|
||||||
|
@ -693,7 +663,7 @@ void TypeInfoAssociativeArrayDeclaration::llvmDeclare()
|
||||||
|
|
||||||
void TypeInfoAssociativeArrayDeclaration::llvmDefine()
|
void TypeInfoAssociativeArrayDeclaration::llvmDefine()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoAssociativeArrayDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoAssociativeArrayDeclaration::llvmDefine() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
// init typeinfo class
|
// init typeinfo class
|
||||||
|
@ -730,16 +700,11 @@ void TypeInfoAssociativeArrayDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoAssociativeArrayDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoFunctionDeclaration::llvmDeclare()
|
void TypeInfoFunctionDeclaration::llvmDeclare()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoFunctionDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoFunctionDeclaration::llvmDeclare() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
assert(tinfo->ty == Tfunction);
|
assert(tinfo->ty == Tfunction);
|
||||||
|
@ -750,7 +715,7 @@ void TypeInfoFunctionDeclaration::llvmDeclare()
|
||||||
|
|
||||||
void TypeInfoFunctionDeclaration::llvmDefine()
|
void TypeInfoFunctionDeclaration::llvmDefine()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoFunctionDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoFunctionDeclaration::llvmDefine() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
assert(tinfo->ty == Tfunction);
|
assert(tinfo->ty == Tfunction);
|
||||||
|
@ -759,16 +724,11 @@ void TypeInfoFunctionDeclaration::llvmDefine()
|
||||||
LLVM_D_Define_TypeInfoBase(tc->next, this, Type::typeinfofunction);
|
LLVM_D_Define_TypeInfoBase(tc->next, this, Type::typeinfofunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoFunctionDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoDelegateDeclaration::llvmDeclare()
|
void TypeInfoDelegateDeclaration::llvmDeclare()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoDelegateDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoDelegateDeclaration::llvmDeclare() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
assert(tinfo->ty == Tdelegate);
|
assert(tinfo->ty == Tdelegate);
|
||||||
|
@ -779,7 +739,7 @@ void TypeInfoDelegateDeclaration::llvmDeclare()
|
||||||
|
|
||||||
void TypeInfoDelegateDeclaration::llvmDefine()
|
void TypeInfoDelegateDeclaration::llvmDefine()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoDelegateDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoDelegateDeclaration::llvmDefine() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
assert(tinfo->ty == Tdelegate);
|
assert(tinfo->ty == Tdelegate);
|
||||||
|
@ -788,11 +748,6 @@ void TypeInfoDelegateDeclaration::llvmDefine()
|
||||||
LLVM_D_Define_TypeInfoBase(tc->nextOf()->nextOf(), this, Type::typeinfodelegate);
|
LLVM_D_Define_TypeInfoBase(tc->nextOf()->nextOf(), this, Type::typeinfodelegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoDelegateDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoStructDeclaration::llvmDeclare()
|
void TypeInfoStructDeclaration::llvmDeclare()
|
||||||
|
@ -1007,11 +962,6 @@ void TypeInfoStructDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoStructDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoClassDeclaration::llvmDeclare()
|
void TypeInfoClassDeclaration::llvmDeclare()
|
||||||
|
@ -1063,11 +1013,6 @@ void TypeInfoClassDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoClassDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoInterfaceDeclaration::llvmDeclare()
|
void TypeInfoInterfaceDeclaration::llvmDeclare()
|
||||||
|
@ -1121,11 +1066,6 @@ void TypeInfoInterfaceDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoInterfaceDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoTupleDeclaration::llvmDeclare()
|
void TypeInfoTupleDeclaration::llvmDeclare()
|
||||||
|
@ -1208,18 +1148,13 @@ void TypeInfoTupleDeclaration::llvmDefine()
|
||||||
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
isaGlobalVar(ir.irGlobal->value)->setInitializer(tiInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoTupleDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
#if DMDV2
|
#if DMDV2
|
||||||
|
|
||||||
void TypeInfoConstDeclaration::llvmDeclare()
|
void TypeInfoConstDeclaration::llvmDeclare()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoConstDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoConstDeclaration::llvmDeclare() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
LLVM_D_Declare_TypeInfoBase(this, Type::typeinfoconst);
|
LLVM_D_Declare_TypeInfoBase(this, Type::typeinfoconst);
|
||||||
|
@ -1227,7 +1162,7 @@ void TypeInfoConstDeclaration::llvmDeclare()
|
||||||
|
|
||||||
void TypeInfoConstDeclaration::llvmDefine()
|
void TypeInfoConstDeclaration::llvmDefine()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoConstDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoConstDeclaration::llvmDefine() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
Type *tm = tinfo->mutableOf();
|
Type *tm = tinfo->mutableOf();
|
||||||
|
@ -1236,18 +1171,11 @@ void TypeInfoConstDeclaration::llvmDefine()
|
||||||
LLVM_D_Define_TypeInfoBase(tm, this, Type::typeinfoconst);
|
LLVM_D_Define_TypeInfoBase(tm, this, Type::typeinfoconst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoConstDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
|
|
||||||
void TypeInfoInvariantDeclaration::llvmDeclare()
|
void TypeInfoInvariantDeclaration::llvmDeclare()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoInvariantDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoInvariantDeclaration::llvmDeclare() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
LLVM_D_Declare_TypeInfoBase(this, Type::typeinfoinvariant);
|
LLVM_D_Declare_TypeInfoBase(this, Type::typeinfoinvariant);
|
||||||
|
@ -1255,7 +1183,7 @@ void TypeInfoInvariantDeclaration::llvmDeclare()
|
||||||
|
|
||||||
void TypeInfoInvariantDeclaration::llvmDefine()
|
void TypeInfoInvariantDeclaration::llvmDefine()
|
||||||
{
|
{
|
||||||
Logger::println("TypeInfoInvariantDeclaration::toDt() %s", toChars());
|
Logger::println("TypeInfoInvariantDeclaration::llvmDefine() %s", toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
Type *tm = tinfo->mutableOf();
|
Type *tm = tinfo->mutableOf();
|
||||||
|
@ -1264,9 +1192,4 @@ void TypeInfoInvariantDeclaration::llvmDefine()
|
||||||
LLVM_D_Define_TypeInfoBase(tm, this, Type::typeinfoinvariant);
|
LLVM_D_Define_TypeInfoBase(tm, this, Type::typeinfoinvariant);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeInfoInvariantDeclaration::toDt(dt_t **pdt)
|
|
||||||
{
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "gen/llvm.h"
|
#include "gen/llvm.h"
|
||||||
#include "ir/ir.h"
|
#include "ir/ir.h"
|
||||||
#include "ir/irsymbol.h"
|
#include "ir/irdsymbol.h"
|
||||||
#include "ir/irvar.h"
|
#include "ir/irvar.h"
|
||||||
|
|
||||||
#include "gen/logger.h"
|
#include "gen/logger.h"
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef LDC_IR_IRSYMBOL_H
|
#ifndef LDC_IR_IRDSYMBOL_H
|
||||||
#define LDC_IR_IRSYMBOL_H
|
#define LDC_IR_IRDSYMBOL_H
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue