diff dmd/Type.d @ 176:fa9a71a9f5a8

Moved all the mutable globals to Global
author korDen
date Sun, 10 Oct 2010 05:22:45 +0400
parents af724d3510d7
children 1475fd394c9e
line wrap: on
line diff
--- a/dmd/Type.d	Sun Oct 10 03:48:06 2010 +0400
+++ b/dmd/Type.d	Sun Oct 10 05:22:45 2010 +0400
@@ -259,7 +259,6 @@
 
     type* ctype;	// for back end
 
-    static __gshared Type basic[TY.TMAX];
     static __gshared ubyte mangleChar[TY.TMAX];
     static __gshared ubyte sizeTy[TY.TMAX];
 
@@ -740,8 +739,8 @@
 
 		basic[TY.Terror] = basic[TY.Tint32];
 
-		tvoidptr = tvoid.pointerTo();
-		tstring = tchar.invariantOf().arrayOf();
+		global.tvoidptr = tvoid.pointerTo();
+		global.tstring = tchar.invariantOf().arrayOf();
 
 		if (global.params.isX86_64) {
 			PTRSIZE = 8;
@@ -2503,8 +2502,6 @@
 		*pe = null;
 		*ps = null;
 	}
-	
-	static __gshared TypeInfoDeclaration internalTI[TMAX];
 
 	/*******************************************
 	 * Get a canonicalized form of the TypeInfo for use with the internal
@@ -2546,11 +2543,11 @@
 			case Tdelegate:
 			case Tpointer:
 			Linternal:
-				tid = internalTI[t.ty];
+				tid = global.internalTI[t.ty];
 				if (!tid)
 				{
 					tid = new TypeInfoDeclaration(t, 1);
-					internalTI[t.ty] = tid;
+					global.internalTI[t.ty] = tid;
 				}
 				e = new VarExp(Loc(0), tid);
 				e = e.addressOf(sc);
@@ -2850,6 +2847,12 @@
 	{
 		return null;
 	}
+	
+	@property
+	static ref Type[TY.TMAX] basic()
+	{
+		return basic;
+	}
 
 	static Type tvoid()
 	{
@@ -2983,9 +2986,6 @@
 		return tint32;		// array/ptr index
 	}
 
-    static __gshared Type tvoidptr;		// void*
-    static __gshared Type tstring;		// immutable(char)[]
-
 	static Type terror()
 	{
 		return basic[TY.Terror];	// for error recovery