mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-06 20:09:03 +02:00
First merge of 2.064 beta.
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb. Doesn't build Phobos yet.
This commit is contained in:
committed by
Kai Nacke
parent
c400d180d2
commit
cb341586e3
@@ -30,24 +30,22 @@
|
||||
#include "lexer.h"
|
||||
#include "mtype.h"
|
||||
|
||||
struct Expression;
|
||||
struct Statement;
|
||||
struct LabelDsymbol;
|
||||
#if IN_LLVM
|
||||
struct LabelStatement;
|
||||
#endif
|
||||
struct Initializer;
|
||||
struct Module;
|
||||
class Expression;
|
||||
class Statement;
|
||||
class LabelDsymbol;
|
||||
class Initializer;
|
||||
class Module;
|
||||
struct InlineScanState;
|
||||
struct ForeachStatement;
|
||||
struct FuncDeclaration;
|
||||
struct ExpInitializer;
|
||||
struct StructDeclaration;
|
||||
struct TupleType;
|
||||
class ForeachStatement;
|
||||
class FuncDeclaration;
|
||||
class ExpInitializer;
|
||||
class StructDeclaration;
|
||||
struct InterState;
|
||||
struct IRState;
|
||||
struct CompiledCtfeFunction;
|
||||
#if IN_LLVM
|
||||
struct AnonDeclaration;
|
||||
class AnonDeclaration;
|
||||
class LabelStatement;
|
||||
#endif
|
||||
|
||||
enum PROT;
|
||||
@@ -104,11 +102,11 @@ enum PURE;
|
||||
#define STCtemp 0x10000000000LL // temporary variable introduced by inlining
|
||||
// and used only in backend process, so it's rvalue
|
||||
|
||||
#define STCStorageClass (STCauto | STCscope | STCstatic | STCextern | STCconst | STCfinal | \
|
||||
STCabstract | STCsynchronized | STCdeprecated | STCoverride | STClazy | STCalias | \
|
||||
STCout | STCin | \
|
||||
STCmanifest | STCimmutable | STCshared | STCnothrow | STCpure | STCref | STCtls | \
|
||||
STCgshared | STCproperty | STCsafe | STCtrusted | STCsystem | STCdisable)
|
||||
const StorageClass STCStorageClass = (STCauto | STCscope | STCstatic | STCextern | STCconst | STCfinal |
|
||||
STCabstract | STCsynchronized | STCdeprecated | STCoverride | STClazy | STCalias |
|
||||
STCout | STCin |
|
||||
STCmanifest | STCimmutable | STCshared | STCnothrow | STCpure | STCref | STCtls |
|
||||
STCgshared | STCproperty | STCsafe | STCtrusted | STCsystem | STCdisable);
|
||||
|
||||
struct Match
|
||||
{
|
||||
@@ -119,11 +117,8 @@ struct Match
|
||||
FuncDeclaration *anyf; // pick a func, any func, to use for error recovery
|
||||
};
|
||||
|
||||
void overloadResolveX(Match *m, FuncDeclaration *f,
|
||||
Type *tthis, Expressions *arguments);
|
||||
int overloadApply(FuncDeclaration *fstart,
|
||||
int (*fp)(void *, FuncDeclaration *),
|
||||
void *param);
|
||||
void functionResolve(Match *m, Dsymbol *fd, Loc loc, Scope *sc, Objects *tiargs, Type *tthis, Expressions *fargs);
|
||||
int overloadApply(Dsymbol *fstart, void *param, int (*fp)(void *, Dsymbol *));
|
||||
|
||||
void ObjectNotFound(Identifier *id);
|
||||
|
||||
@@ -137,16 +132,17 @@ enum Semantic
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
struct Declaration : Dsymbol
|
||||
class Declaration : public Dsymbol
|
||||
{
|
||||
public:
|
||||
Type *type;
|
||||
Type *originalType; // before semantic analysis
|
||||
StorageClass storage_class;
|
||||
enum PROT protection;
|
||||
enum LINK linkage;
|
||||
PROT protection;
|
||||
LINK linkage;
|
||||
int inuse; // used to detect cycles
|
||||
const char *mangleOverride; // overridden symbol with pragma(mangle, "...")
|
||||
enum Semantic sem;
|
||||
Semantic sem;
|
||||
|
||||
Declaration(Identifier *id);
|
||||
void semantic(Scope *sc);
|
||||
@@ -163,10 +159,10 @@ struct Declaration : Dsymbol
|
||||
|
||||
const char *mangle(bool isv = false);
|
||||
bool isStatic() { return (storage_class & STCstatic) != 0; }
|
||||
virtual int isDelete();
|
||||
virtual int isDataseg();
|
||||
virtual int isThreadlocal();
|
||||
virtual int isCodeseg();
|
||||
virtual bool isDelete();
|
||||
virtual bool isDataseg();
|
||||
virtual bool isThreadlocal();
|
||||
virtual bool isCodeseg();
|
||||
bool isCtorinit() { return (storage_class & STCctorinit) != 0; }
|
||||
bool isFinal() { return (storage_class & STCfinal) != 0; }
|
||||
bool isAbstract() { return (storage_class & STCabstract) != 0; }
|
||||
@@ -186,17 +182,18 @@ struct Declaration : Dsymbol
|
||||
bool isOut() { return (storage_class & STCout) != 0; }
|
||||
bool isRef() { return (storage_class & STCref) != 0; }
|
||||
|
||||
enum PROT prot();
|
||||
PROT prot();
|
||||
|
||||
Declaration *isDeclaration() { return this; }
|
||||
};
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
struct TupleDeclaration : Declaration
|
||||
class TupleDeclaration : public Declaration
|
||||
{
|
||||
public:
|
||||
Objects *objects;
|
||||
int isexp; // 1: expression tuple
|
||||
bool isexp; // true: expression tuple
|
||||
|
||||
TypeTuple *tupletype; // !=NULL if this is a type tuple
|
||||
|
||||
@@ -204,7 +201,7 @@ struct TupleDeclaration : Declaration
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
const char *kind();
|
||||
Type *getType();
|
||||
int needThis();
|
||||
bool needThis();
|
||||
|
||||
TupleDeclaration *isTupleDeclaration() { return this; }
|
||||
|
||||
@@ -217,8 +214,9 @@ struct TupleDeclaration : Declaration
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
struct TypedefDeclaration : Declaration
|
||||
class TypedefDeclaration : public Declaration
|
||||
{
|
||||
public:
|
||||
Type *basetype;
|
||||
Initializer *init;
|
||||
|
||||
@@ -257,18 +255,19 @@ struct TypedefDeclaration : Declaration
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
struct AliasDeclaration : Declaration
|
||||
class AliasDeclaration : public Declaration
|
||||
{
|
||||
public:
|
||||
Dsymbol *aliassym;
|
||||
Dsymbol *overnext; // next in overload list
|
||||
Dsymbol *import; // !=NULL if unresolved internal alias for selective import
|
||||
int inSemantic;
|
||||
bool inSemantic;
|
||||
|
||||
AliasDeclaration(Loc loc, Identifier *ident, Type *type);
|
||||
AliasDeclaration(Loc loc, Identifier *ident, Dsymbol *s);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
int overloadInsert(Dsymbol *s);
|
||||
bool overloadInsert(Dsymbol *s);
|
||||
const char *kind();
|
||||
Type *getType();
|
||||
Dsymbol *toAlias();
|
||||
@@ -283,8 +282,9 @@ struct AliasDeclaration : Declaration
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
struct VarDeclaration : Declaration
|
||||
class VarDeclaration : public Declaration
|
||||
{
|
||||
public:
|
||||
Initializer *init;
|
||||
unsigned offset;
|
||||
bool noscope; // no auto semantics
|
||||
@@ -329,16 +329,16 @@ struct VarDeclaration : Declaration
|
||||
Type *htype;
|
||||
Initializer *hinit;
|
||||
AggregateDeclaration *isThis();
|
||||
int needThis();
|
||||
int isExport();
|
||||
int isImportedSymbol();
|
||||
int isDataseg();
|
||||
int isThreadlocal();
|
||||
int isCTFE();
|
||||
int hasPointers();
|
||||
bool needThis();
|
||||
bool isExport();
|
||||
bool isImportedSymbol();
|
||||
bool isDataseg();
|
||||
bool isThreadlocal();
|
||||
bool isCTFE();
|
||||
bool hasPointers();
|
||||
#if DMDV2
|
||||
int canTakeAddressOf();
|
||||
int needsAutoDtor();
|
||||
bool canTakeAddressOf();
|
||||
bool needsAutoDtor();
|
||||
#endif
|
||||
Expression *callScopeDtor(Scope *sc);
|
||||
ExpInitializer *getExpInitializer();
|
||||
@@ -347,8 +347,8 @@ struct VarDeclaration : Declaration
|
||||
void checkNestedReference(Scope *sc, Loc loc);
|
||||
Dsymbol *toAlias();
|
||||
#if IN_DMD
|
||||
void toObjFile(int multiobj); // compile to .obj file
|
||||
Symbol *toSymbol();
|
||||
void toObjFile(int multiobj); // compile to .obj file
|
||||
int cvMember(unsigned char *p);
|
||||
#endif
|
||||
const char *mangle(bool isv = false);
|
||||
@@ -381,8 +381,9 @@ struct VarDeclaration : Declaration
|
||||
|
||||
// This is a shell around a back end symbol
|
||||
|
||||
struct SymbolDeclaration : Declaration
|
||||
class SymbolDeclaration : public Declaration
|
||||
{
|
||||
public:
|
||||
StructDeclaration *dsym;
|
||||
|
||||
SymbolDeclaration(Loc loc, StructDeclaration *dsym);
|
||||
@@ -395,8 +396,9 @@ struct SymbolDeclaration : Declaration
|
||||
SymbolDeclaration *isSymbolDeclaration() { return (SymbolDeclaration *)this; }
|
||||
};
|
||||
|
||||
struct ClassInfoDeclaration : VarDeclaration
|
||||
class ClassInfoDeclaration : public VarDeclaration
|
||||
{
|
||||
public:
|
||||
ClassDeclaration *cd;
|
||||
|
||||
ClassInfoDeclaration(ClassDeclaration *cd);
|
||||
@@ -413,40 +415,25 @@ struct ClassInfoDeclaration : VarDeclaration
|
||||
ClassInfoDeclaration* isClassInfoDeclaration() { return this; }
|
||||
};
|
||||
|
||||
struct ModuleInfoDeclaration : VarDeclaration
|
||||
{
|
||||
Module *mod;
|
||||
|
||||
ModuleInfoDeclaration(Module *mod);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
|
||||
void emitComment(Scope *sc);
|
||||
void toJson(JsonOut *json);
|
||||
|
||||
#if IN_DMD
|
||||
Symbol *toSymbol();
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoDeclaration : VarDeclaration
|
||||
class TypeInfoDeclaration : public VarDeclaration
|
||||
{
|
||||
public:
|
||||
Type *tinfo;
|
||||
|
||||
TypeInfoDeclaration(Type *tinfo, int internal);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
char *toChars();
|
||||
|
||||
void emitComment(Scope *sc);
|
||||
void toJson(JsonOut *json);
|
||||
|
||||
#if IN_DMD
|
||||
void toObjFile(int multiobj); // compile to .obj file
|
||||
Symbol *toSymbol();
|
||||
void toObjFile(int multiobj); // compile to .obj file
|
||||
virtual void toDt(dt_t **pdt);
|
||||
#endif
|
||||
|
||||
virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return this; }
|
||||
TypeInfoDeclaration *isTypeInfoDeclaration() { return this; }
|
||||
|
||||
#if IN_LLVM
|
||||
/// Codegen traversal
|
||||
@@ -455,8 +442,9 @@ struct TypeInfoDeclaration : VarDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoStructDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoStructDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoStructDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -468,8 +456,9 @@ struct TypeInfoStructDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoClassDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoClassDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoClassDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -487,8 +476,9 @@ struct TypeInfoClassDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoInterfaceDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoInterfaceDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoInterfaceDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -500,8 +490,9 @@ struct TypeInfoInterfaceDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoTypedefDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoTypedefDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoTypedefDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -513,8 +504,9 @@ struct TypeInfoTypedefDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoPointerDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoPointerDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoPointerDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -526,8 +518,9 @@ struct TypeInfoPointerDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoArrayDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoArrayDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoArrayDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -539,8 +532,9 @@ struct TypeInfoArrayDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoStaticArrayDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoStaticArrayDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -552,8 +546,9 @@ struct TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoAssociativeArrayDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoAssociativeArrayDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -565,8 +560,9 @@ struct TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoEnumDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoEnumDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoEnumDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -578,8 +574,9 @@ struct TypeInfoEnumDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoFunctionDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoFunctionDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoFunctionDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -591,8 +588,9 @@ struct TypeInfoFunctionDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoDelegateDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoDelegateDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoDelegateDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -604,8 +602,9 @@ struct TypeInfoDelegateDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoTupleDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoTupleDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoTupleDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -618,8 +617,9 @@ struct TypeInfoTupleDeclaration : TypeInfoDeclaration
|
||||
};
|
||||
|
||||
#if DMDV2
|
||||
struct TypeInfoConstDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoConstDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoConstDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -631,8 +631,9 @@ struct TypeInfoConstDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoInvariantDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoInvariantDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoInvariantDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -644,8 +645,9 @@ struct TypeInfoInvariantDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoSharedDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoSharedDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoSharedDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -657,8 +659,9 @@ struct TypeInfoSharedDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoWildDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoWildDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoWildDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -670,8 +673,9 @@ struct TypeInfoWildDeclaration : TypeInfoDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TypeInfoVectorDeclaration : TypeInfoDeclaration
|
||||
class TypeInfoVectorDeclaration : public TypeInfoDeclaration
|
||||
{
|
||||
public:
|
||||
TypeInfoVectorDeclaration(Type *tinfo);
|
||||
|
||||
#if IN_DMD
|
||||
@@ -686,8 +690,9 @@ struct TypeInfoVectorDeclaration : TypeInfoDeclaration
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
struct ThisDeclaration : VarDeclaration
|
||||
class ThisDeclaration : public VarDeclaration
|
||||
{
|
||||
public:
|
||||
ThisDeclaration(Loc loc, Type *t);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
ThisDeclaration *isThisDeclaration() { return this; }
|
||||
@@ -726,14 +731,15 @@ enum BUILTIN
|
||||
#endif
|
||||
};
|
||||
|
||||
Expression *eval_builtin(Loc loc, enum BUILTIN builtin, Expressions *arguments);
|
||||
Expression *eval_builtin(Loc loc, BUILTIN builtin, Expressions *arguments);
|
||||
|
||||
#else
|
||||
enum BUILTIN { };
|
||||
#endif
|
||||
|
||||
struct FuncDeclaration : Declaration
|
||||
class FuncDeclaration : public Declaration
|
||||
{
|
||||
public:
|
||||
Types *fthrows; // Array of Type's of exceptions (not used)
|
||||
Statement *frequire;
|
||||
Statement *fensure;
|
||||
@@ -766,28 +772,30 @@ struct FuncDeclaration : Declaration
|
||||
VarDeclaration *v_argsave; // save area for args passed in registers for variadic functions
|
||||
VarDeclarations *parameters; // Array of VarDeclaration's for parameters
|
||||
DsymbolTable *labtab; // statement label symbol table
|
||||
Declaration *overnext; // next in overload list
|
||||
Dsymbol *overnext; // next in overload list
|
||||
FuncDeclaration *overnext0; // next in overload list (only used during IFTI)
|
||||
Loc endloc; // location of closing curly bracket
|
||||
int vtblIndex; // for member functions, index into vtbl[]
|
||||
bool naked; // !=0 if naked
|
||||
bool naked; // true if naked
|
||||
ILS inlineStatusStmt;
|
||||
ILS inlineStatusExp;
|
||||
|
||||
CompiledCtfeFunction *ctfeCode; // Compiled code for interpreter
|
||||
int inlineNest; // !=0 if nested inline
|
||||
#if IN_LLVM
|
||||
char isArrayOp; // 1 if compiler-generated array op, 2 if druntime-provided
|
||||
#else
|
||||
bool isArrayOp; // !=0 if array operation
|
||||
bool isArrayOp; // true if array operation
|
||||
#endif
|
||||
FuncDeclaration *dArrayOp; // D version of array op for ctfe
|
||||
enum PASS semanticRun;
|
||||
int semantic3Errors; // !=0 if errors in semantic3
|
||||
// this function's frame ptr
|
||||
ForeachStatement *fes; // if foreach body, this is the foreach
|
||||
bool introducing; // !=0 if 'introducing' function
|
||||
bool introducing; // true if 'introducing' function
|
||||
Type *tintro; // if !=NULL, then this is the type
|
||||
// of the 'introducing' function
|
||||
// this one is overriding
|
||||
int inferRetType; // !=0 if return type is to be inferred
|
||||
bool inferRetType; // true if return type is to be inferred
|
||||
StorageClass storage_class2; // storage class for template onemember's
|
||||
|
||||
// Things that should really go into Scope
|
||||
@@ -797,7 +805,7 @@ struct FuncDeclaration : Declaration
|
||||
// 8 if there's inline asm
|
||||
|
||||
// Support for NRVO (named return value optimization)
|
||||
bool nrvo_can; // !=0 means we can do it
|
||||
bool nrvo_can; // true means we can do it
|
||||
VarDeclaration *nrvo_var; // variable to replace with shidden
|
||||
#if IN_DMD
|
||||
Symbol *shidden; // hidden pointer passed to function
|
||||
@@ -806,7 +814,7 @@ struct FuncDeclaration : Declaration
|
||||
ReturnStatements *returns;
|
||||
|
||||
#if DMDV2
|
||||
enum BUILTIN builtin; // set if this is a known, builtin
|
||||
BUILTIN builtin; // set if this is a known, builtin
|
||||
// function we can evaluate at compile
|
||||
// time
|
||||
|
||||
@@ -839,16 +847,16 @@ struct FuncDeclaration : Declaration
|
||||
bool functionSemantic3();
|
||||
// called from semantic3
|
||||
VarDeclaration *declareThis(Scope *sc, AggregateDeclaration *ad);
|
||||
int equals(Object *o);
|
||||
bool equals(RootObject *o);
|
||||
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void toJson(JsonOut *json);
|
||||
int overrides(FuncDeclaration *fd);
|
||||
int findVtblIndex(Dsymbols *vtbl, int dim);
|
||||
int overloadInsert(Dsymbol *s);
|
||||
bool overloadInsert(Dsymbol *s);
|
||||
FuncDeclaration *overloadExactMatch(Type *t);
|
||||
FuncDeclaration *overloadResolve(Loc loc, Type *tthis, Expressions *arguments, int flags = 0);
|
||||
TemplateDeclaration *findTemplateDeclRoot();
|
||||
MATCH leastAsSpecialized(FuncDeclaration *g);
|
||||
LabelDsymbol *searchLabel(Identifier *ident);
|
||||
AggregateDeclaration *isThis();
|
||||
@@ -857,35 +865,36 @@ struct FuncDeclaration : Declaration
|
||||
void appendExp(Expression *e);
|
||||
void appendState(Statement *s);
|
||||
const char *mangle(bool isv = false);
|
||||
const char *mangleExact(bool isv = false);
|
||||
const char *toPrettyChars();
|
||||
const char *toFullSignature(); // for diagnostics, e.g. 'int foo(int x, int y) pure'
|
||||
int isMain();
|
||||
int isWinMain();
|
||||
int isDllMain();
|
||||
enum BUILTIN isBuiltin();
|
||||
int isExport();
|
||||
int isImportedSymbol();
|
||||
int isAbstract();
|
||||
int isCodeseg();
|
||||
int isOverloadable();
|
||||
int hasOverloads();
|
||||
enum PURE isPure();
|
||||
enum PURE isPureBypassingInference();
|
||||
bool isMain();
|
||||
bool isWinMain();
|
||||
bool isDllMain();
|
||||
BUILTIN isBuiltin();
|
||||
bool isExport();
|
||||
bool isImportedSymbol();
|
||||
bool isCodeseg();
|
||||
bool isOverloadable();
|
||||
bool hasOverloads();
|
||||
PURE isPure();
|
||||
PURE isPureBypassingInference();
|
||||
bool setImpure();
|
||||
int isSafe();
|
||||
bool isSafe();
|
||||
bool isSafeBypassingInference();
|
||||
int isTrusted();
|
||||
bool isTrusted();
|
||||
bool setUnsafe();
|
||||
bool isolateReturn();
|
||||
bool parametersIntersect(Type *t);
|
||||
virtual int isNested();
|
||||
int needThis();
|
||||
int isVirtualMethod();
|
||||
virtual int isVirtual();
|
||||
virtual int isFinal();
|
||||
virtual int addPreInvariant();
|
||||
virtual int addPostInvariant();
|
||||
virtual bool isNested();
|
||||
bool needThis();
|
||||
bool isVirtualMethod();
|
||||
virtual bool isVirtual();
|
||||
virtual bool isFinalFunc();
|
||||
virtual bool addPreInvariant();
|
||||
virtual bool addPostInvariant();
|
||||
Expression *interpret(InterState *istate, Expressions *arguments, Expression *thisexp = NULL);
|
||||
void ctfeCompile();
|
||||
void inlineScan();
|
||||
int canInline(int hasthis, int hdrscan, int statementsToo);
|
||||
Expression *expandInline(InlineScanState *iss, Expression *ethis, Expressions *arguments, Statement **ps);
|
||||
@@ -893,11 +902,11 @@ struct FuncDeclaration : Declaration
|
||||
void toDocBuffer(OutBuffer *buf, Scope *sc);
|
||||
FuncDeclaration *isUnique();
|
||||
void checkNestedReference(Scope *sc, Loc loc);
|
||||
int needsClosure();
|
||||
int hasNestedFrameRefs();
|
||||
bool needsClosure();
|
||||
bool hasNestedFrameRefs();
|
||||
void buildResultVar();
|
||||
Statement *mergeFrequire(Statement *, Expressions *params = 0);
|
||||
Statement *mergeFensure(Statement *, Expressions *params = 0);
|
||||
Statement *mergeFensure(Statement *, Identifier *oid, Expressions *params = 0);
|
||||
Parameters *getParameters(int *pvarargs);
|
||||
|
||||
// LDC: give argument types to runtime functions
|
||||
@@ -959,34 +968,36 @@ FuncDeclaration *resolveFuncCall(Loc loc, Scope *sc, Dsymbol *s,
|
||||
int flags = 0);
|
||||
#endif
|
||||
|
||||
struct FuncAliasDeclaration : FuncDeclaration
|
||||
class FuncAliasDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
FuncDeclaration *funcalias;
|
||||
int hasOverloads;
|
||||
bool hasOverloads;
|
||||
|
||||
FuncAliasDeclaration(FuncDeclaration *funcalias, int hasOverloads = 1);
|
||||
FuncAliasDeclaration(FuncDeclaration *funcalias, bool hasOverloads = true);
|
||||
|
||||
FuncAliasDeclaration *isFuncAliasDeclaration() { return this; }
|
||||
const char *kind();
|
||||
#if IN_DMD
|
||||
Symbol *toSymbol();
|
||||
#endif
|
||||
const char *mangle(bool isv = false) { return toAliasFunc()->mangle(isv); }
|
||||
const char *mangle(bool isv = false);
|
||||
|
||||
FuncDeclaration *toAliasFunc();
|
||||
};
|
||||
|
||||
struct FuncLiteralDeclaration : FuncDeclaration
|
||||
class FuncLiteralDeclaration : public FuncDeclaration
|
||||
{
|
||||
enum TOK tok; // TOKfunction or TOKdelegate
|
||||
public:
|
||||
TOK tok; // TOKfunction or TOKdelegate
|
||||
Type *treq; // target of return type inference
|
||||
|
||||
FuncLiteralDeclaration(Loc loc, Loc endloc, Type *type, enum TOK tok,
|
||||
ForeachStatement *fes);
|
||||
FuncLiteralDeclaration(Loc loc, Loc endloc, Type *type, TOK tok,
|
||||
ForeachStatement *fes, Identifier *id = NULL);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
int isNested();
|
||||
int isVirtual();
|
||||
bool isNested();
|
||||
bool isVirtual();
|
||||
|
||||
FuncLiteralDeclaration *isFuncLiteralDeclaration() { return this; }
|
||||
const char *kind();
|
||||
@@ -1002,40 +1013,43 @@ struct FuncLiteralDeclaration : FuncDeclaration
|
||||
#endif
|
||||
};
|
||||
|
||||
struct CtorDeclaration : FuncDeclaration
|
||||
class CtorDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
CtorDeclaration(Loc loc, Loc endloc, StorageClass stc, Type *type);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
const char *kind();
|
||||
char *toChars();
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
|
||||
CtorDeclaration *isCtorDeclaration() { return this; }
|
||||
};
|
||||
|
||||
#if DMDV2
|
||||
struct PostBlitDeclaration : FuncDeclaration
|
||||
class PostBlitDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
PostBlitDeclaration(Loc loc, Loc endloc, StorageClass stc, Identifier *id);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
void toJson(JsonOut *json);
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
int overloadInsert(Dsymbol *s);
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
bool overloadInsert(Dsymbol *s);
|
||||
void emitComment(Scope *sc);
|
||||
|
||||
PostBlitDeclaration *isPostBlitDeclaration() { return this; }
|
||||
};
|
||||
#endif
|
||||
|
||||
struct DtorDeclaration : FuncDeclaration
|
||||
class DtorDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
DtorDeclaration(Loc loc, Loc endloc);
|
||||
DtorDeclaration(Loc loc, Loc endloc, StorageClass stc, Identifier *id);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
@@ -1043,25 +1057,26 @@ struct DtorDeclaration : FuncDeclaration
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
const char *kind();
|
||||
char *toChars();
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
int overloadInsert(Dsymbol *s);
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
bool overloadInsert(Dsymbol *s);
|
||||
void emitComment(Scope *sc);
|
||||
|
||||
DtorDeclaration *isDtorDeclaration() { return this; }
|
||||
};
|
||||
|
||||
struct StaticCtorDeclaration : FuncDeclaration
|
||||
class StaticCtorDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
StaticCtorDeclaration(Loc loc, Loc endloc);
|
||||
StaticCtorDeclaration(Loc loc, Loc endloc, const char *name);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
AggregateDeclaration *isThis();
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
bool hasStaticCtorOrDtor();
|
||||
void emitComment(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
@@ -1070,8 +1085,9 @@ struct StaticCtorDeclaration : FuncDeclaration
|
||||
};
|
||||
|
||||
#if DMDV2
|
||||
struct SharedStaticCtorDeclaration : StaticCtorDeclaration
|
||||
class SharedStaticCtorDeclaration : public StaticCtorDeclaration
|
||||
{
|
||||
public:
|
||||
SharedStaticCtorDeclaration(Loc loc, Loc endloc);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
@@ -1080,18 +1096,20 @@ struct SharedStaticCtorDeclaration : StaticCtorDeclaration
|
||||
};
|
||||
#endif
|
||||
|
||||
struct StaticDtorDeclaration : FuncDeclaration
|
||||
{ VarDeclaration *vgate; // 'gate' variable
|
||||
class StaticDtorDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
VarDeclaration *vgate; // 'gate' variable
|
||||
|
||||
StaticDtorDeclaration(Loc loc, Loc endloc);
|
||||
StaticDtorDeclaration(Loc loc, Loc endloc, const char *name);
|
||||
StaticDtorDeclaration(Loc loc, Loc endloc, StorageClass stc);
|
||||
StaticDtorDeclaration(Loc loc, Loc endloc, const char *name, StorageClass stc);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
AggregateDeclaration *isThis();
|
||||
int isVirtual();
|
||||
bool isVirtual();
|
||||
bool hasStaticCtorOrDtor();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
void emitComment(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
|
||||
@@ -1099,9 +1117,10 @@ struct StaticDtorDeclaration : FuncDeclaration
|
||||
};
|
||||
|
||||
#if DMDV2
|
||||
struct SharedStaticDtorDeclaration : StaticDtorDeclaration
|
||||
class SharedStaticDtorDeclaration : public StaticDtorDeclaration
|
||||
{
|
||||
SharedStaticDtorDeclaration(Loc loc, Loc endloc);
|
||||
public:
|
||||
SharedStaticDtorDeclaration(Loc loc, Loc endloc, StorageClass stc);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
|
||||
@@ -1109,38 +1128,42 @@ struct SharedStaticDtorDeclaration : StaticDtorDeclaration
|
||||
};
|
||||
#endif
|
||||
|
||||
struct InvariantDeclaration : FuncDeclaration
|
||||
class InvariantDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
InvariantDeclaration(Loc loc, Loc endloc, StorageClass stc, Identifier *id = NULL);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
void emitComment(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
|
||||
InvariantDeclaration *isInvariantDeclaration() { return this; }
|
||||
};
|
||||
|
||||
struct UnitTestDeclaration : FuncDeclaration
|
||||
class UnitTestDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
char *codedoc; /** For documented unittest. */
|
||||
UnitTestDeclaration(Loc loc, Loc endloc, char *codedoc);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
AggregateDeclaration *isThis();
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
void emitComment(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
|
||||
UnitTestDeclaration *isUnitTestDeclaration() { return this; }
|
||||
};
|
||||
|
||||
struct NewDeclaration : FuncDeclaration
|
||||
{ Parameters *arguments;
|
||||
class NewDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
Parameters *arguments;
|
||||
int varargs;
|
||||
|
||||
NewDeclaration(Loc loc, Loc endloc, Parameters *arguments, int varargs);
|
||||
@@ -1148,26 +1171,28 @@ struct NewDeclaration : FuncDeclaration
|
||||
void semantic(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
const char *kind();
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
|
||||
NewDeclaration *isNewDeclaration() { return this; }
|
||||
};
|
||||
|
||||
|
||||
struct DeleteDeclaration : FuncDeclaration
|
||||
{ Parameters *arguments;
|
||||
class DeleteDeclaration : public FuncDeclaration
|
||||
{
|
||||
public:
|
||||
Parameters *arguments;
|
||||
|
||||
DeleteDeclaration(Loc loc, Loc endloc, Parameters *arguments);
|
||||
Dsymbol *syntaxCopy(Dsymbol *);
|
||||
void semantic(Scope *sc);
|
||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||
const char *kind();
|
||||
int isDelete();
|
||||
int isVirtual();
|
||||
int addPreInvariant();
|
||||
int addPostInvariant();
|
||||
bool isDelete();
|
||||
bool isVirtual();
|
||||
bool addPreInvariant();
|
||||
bool addPostInvariant();
|
||||
DeleteDeclaration *isDeleteDeclaration() { return this; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user