diff dmd2/mtype.h @ 1577:e4f7b5d9c68a

DMD 2.032 Merge.
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 08 Sep 2009 10:07:56 +0100
parents 54b3c1394d62
children
line wrap: on
line diff
--- a/dmd2/mtype.h	Tue Aug 25 21:35:43 2009 +0200
+++ b/dmd2/mtype.h	Tue Sep 08 10:07:56 2009 +0100
@@ -60,9 +60,10 @@
 
 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 @@
 	#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 @@
     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 @@
     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 @@
     TypeInfoDeclaration *getTypeInfoDeclaration();
     Expression *toExpression();
     int hasPointers();
-#if POSIX
+#if CPP_MANGLE
     void toCppMangle(OutBuffer *buf, CppMangleState *cms);
 #endif
 
@@ -443,7 +448,7 @@
     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 @@
     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 @@
     TypeInfoDeclaration *getTypeInfoDeclaration();
     int hasPointers();
 
-#if POSIX
+#if CPP_MANGLE
     void toCppMangle(OutBuffer *buf, CppMangleState *cms);
 #endif
 
@@ -519,7 +524,7 @@
     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 @@
 			// 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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     TypeInfoDeclaration *getTypeInfoDeclaration();
     int hasPointers();
     Type *toHeadMutable();
-#if POSIX
+#if CPP_MANGLE
     void toCppMangle(OutBuffer *buf, CppMangleState *cms);
 #endif
 
@@ -821,7 +827,7 @@
 #if DMDV2
     Type *toHeadMutable();
     MATCH constConv(Type *to);
-#if POSIX
+#if CPP_MANGLE
     void toCppMangle(OutBuffer *buf, CppMangleState *cms);
 #endif
 #endif