DMD 2.032 Merge.

This commit is contained in:
Robert Clipsham
2009-09-08 10:07:56 +01:00
parent 8b6f11938a
commit 089e792258
38 changed files with 1732 additions and 586 deletions

View File

@@ -60,9 +60,10 @@ struct Symbol;
enum ENUMTY
{
Tarray, // dynamic array
Tsarray, // static array
Taarray, // associative array
Tarray, // slice array, aka T[]
Tsarray, // static array, aka T[dimension]
Tnarray, // resizable array, aka T[new]
Taarray, // associative array, aka T[type]
Tpointer,
Treference,
Tfunction,
@@ -128,7 +129,10 @@ struct Type : Object
#define MODshared 2 // type is shared
char *deco;
/* Note that there is no "shared immutable", because that is just immutable
/* These are cached values that are lazily evaluated by constOf(), invariantOf(), etc.
* They should not be referenced by anybody but mtype.c.
* They can be NULL if not lazily evaluated yet.
* Note that there is no "shared immutable", because that is just immutable
*/
Type *cto; // MODconst ? mutable version of this type : const version
@@ -242,7 +246,8 @@ struct Type : Object
virtual void toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs);
virtual void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod);
void toCBuffer3(OutBuffer *buf, HdrGenState *hgs, int mod);
#if POSIX
void modToBuffer(OutBuffer *buf);
#if CPP_MANGLE
virtual void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
virtual int isintegral();
@@ -359,7 +364,7 @@ struct TypeBasic : Type
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
char *toChars();
void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod);
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
int isintegral();
@@ -413,7 +418,7 @@ struct TypeSArray : TypeArray
TypeInfoDeclaration *getTypeInfoDeclaration();
Expression *toExpression();
int hasPointers();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -443,7 +448,7 @@ struct TypeDArray : TypeArray
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
int hasPointers();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -472,7 +477,7 @@ struct TypeAArray : TypeArray
int hasPointers();
MATCH implicitConvTo(Type *to);
MATCH constConv(Type *to);
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -500,7 +505,7 @@ struct TypePointer : TypeNext
TypeInfoDeclaration *getTypeInfoDeclaration();
int hasPointers();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -519,7 +524,7 @@ struct TypeReference : TypeNext
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
Expression *defaultInit(Loc loc);
int isZeroInit(Loc loc);
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
};
@@ -539,6 +544,7 @@ struct TypeFunction : TypeNext
// 2: T t ...) style for variable number of arguments
bool isnothrow; // true: nothrow
bool ispure; // true: pure
bool isproperty; // can be called without parentheses
bool isref; // true: returns a reference
enum LINK linkage; // calling convention
@@ -553,7 +559,7 @@ struct TypeFunction : TypeNext
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
Type *reliesOnTident();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
bool parameterEscapes(Argument *p);
@@ -591,7 +597,7 @@ struct TypeDelegate : TypeNext
TypeInfoDeclaration *getTypeInfoDeclaration();
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
int hasPointers();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -697,7 +703,7 @@ struct TypeStruct : Type
MATCH implicitConvTo(Type *to);
MATCH constConv(Type *to);
Type *toHeadMutable();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -738,7 +744,7 @@ struct TypeEnum : Type
MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
int hasPointers();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -784,7 +790,7 @@ struct TypeTypedef : Type
TypeInfoDeclaration *getTypeInfoDeclaration();
int hasPointers();
Type *toHeadMutable();
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
@@ -821,7 +827,7 @@ struct TypeClass : Type
#if DMDV2
Type *toHeadMutable();
MATCH constConv(Type *to);
#if POSIX
#if CPP_MANGLE
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
#endif