diff dmd/TypeInfoStructDeclaration.d @ 174:af724d3510d7

lot os toCBuffer methods implemented moved shared Type.* stuff into Global
author korDen
date Sun, 10 Oct 2010 03:47:23 +0400
parents e8a741997ccf
children fa9a71a9f5a8
line wrap: on
line diff
--- a/dmd/TypeInfoStructDeclaration.d	Sun Oct 10 01:55:35 2010 +0400
+++ b/dmd/TypeInfoStructDeclaration.d	Sun Oct 10 03:47:23 2010 +0400
@@ -16,6 +16,7 @@
 import dmd.Scope;
 import dmd.LINK;
 import dmd.Id;
+import dmd.Global;
 import dmd.TypeInfoDeclaration;
 import dmd.backend.dt_t;
 import dmd.backend.TYM;
@@ -29,16 +30,19 @@
 	this(Type tinfo)
 	{
 		super(tinfo, 0);
-	    type = Type.typeinfostruct.type;
+	    type = global.typeinfostruct.type;
 	}
 
+	static __gshared TypeFunction tftohash;
+	static __gshared TypeFunction tftostring;
+
 	override void toDt(dt_t** pdt)
 	{
 		//printf("TypeInfoStructDeclaration.toDt() '%s'\n", toChars());
 
-		uint offset = Type.typeinfostruct.structsize;
+		uint offset = global.typeinfostruct.structsize;
 
-		dtxoff(pdt, Type.typeinfostruct.toVtblSymbol(), 0, TYM.TYnptr); // vtbl for TypeInfo_Struct
+		dtxoff(pdt, global.typeinfostruct.toVtblSymbol(), 0, TYM.TYnptr); // vtbl for TypeInfo_Struct
 		dtdword(pdt, 0);			    // monitor
 
 		assert(tinfo.ty == TY.Tstruct);
@@ -81,9 +85,6 @@
 		Type ta;
 		Dsymbol s;
 
-		static TypeFunction tftohash;
-		static TypeFunction tftostring;
-
 		if (!tftohash)
 		{
 			scope Scope sc = new Scope();
@@ -97,7 +98,7 @@
 		}
 
 		TypeFunction tfeqptr;
-		{	
+		{
 			// bool opEqual(const T*) const;
 			scope sc = new Scope();
 			auto arguments = new Parameters;
@@ -153,7 +154,7 @@
 		s = search_function(sd, Id.tohash);
 		fdx = s ? s.isFuncDeclaration() : null;
 		if (fdx)
-		{	
+		{
 			fd = fdx.overloadExactMatch(tftohash);
 			if (fd)
 				dtxoff(pdt, fd.toSymbol(), 0, TYM.TYnptr);
@@ -186,11 +187,11 @@
 		}
 		else
 			dtdword(pdt, 0);
-	
+
 		s = search_function(sd, Id.tostring);
 		fdx = s ? s.isFuncDeclaration() : null;
 		if (fdx)
-		{	
+		{
 			fd = fdx.overloadExactMatch(tftostring);
 			if (fd)
 				dtxoff(pdt, fd.toSymbol(), 0, TYM.TYnptr);