changeset 192:eb38fdcb3e62 default tip

updated to compile with dmd2.062
author korDen
date Sat, 02 Mar 2013 01:25:52 -0800
parents 52188e7e3fb5
children
files buildHelper.d dmd/DelegateExp.d dmd/FuncExp.d dmd/Global.d dmd/GlobalExpressions.d dmd/Library.d dmd/NewExp.d dmd/SharedStaticCtorDeclaration.d dmd/SharedStaticDtorDeclaration.d dmd/SymOffExp.d dmd/backend/iasm.d
diffstat 11 files changed, 34 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/buildHelper.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/buildHelper.d	Sat Mar 02 01:25:52 2013 -0800
@@ -95,7 +95,7 @@
 void makePathTo(string file)
 {
 	file = normFilePath(file);
-	auto dir = dirname(file);
+	auto dir = dirName(file);
 	makePath(dir);
 }
 
@@ -103,8 +103,8 @@
 string normDirPath(string str)
 {
 	str = normPathSep(str);
-	if(str.length > 0 && str[$-1] != sep[0])
-		str ~= sep;
+	if(str.length > 0 && str[$-1] != dirSeparator[0])
+		str ~= dirSeparator;
 	
 	return str;
 }
@@ -113,7 +113,7 @@
 string normFilePath(string str)
 {
 	str = normPathSep(str);
-	if(str.length > 0 && str[$-1] == sep[0])
+	if(str.length > 0 && str[$-1] == dirSeparator[0])
 		str = str[0..$-1];
 	
 	return str;
--- a/dmd/DelegateExp.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/DelegateExp.d	Sat Mar 02 01:25:52 2013 -0800
@@ -61,7 +61,7 @@
 		return this;
 	}
 	
-    Expression interpret(InterState istate)
+    override Expression interpret(InterState istate)
 	{
 version (LOG) {
 		printf("DelegateExp::interpret() %s\n", toChars());
--- a/dmd/FuncExp.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/FuncExp.d	Sat Mar 02 01:25:52 2013 -0800
@@ -91,7 +91,7 @@
 		return this;
 	}
 	
-    Expression interpret(InterState istate)
+    override Expression interpret(InterState istate)
 	{
 version (LOG) {
 		writef("FuncExp::interpret() %s\n", toChars());
--- a/dmd/Global.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/Global.d	Sat Mar 02 01:25:52 2013 -0800
@@ -21,6 +21,7 @@
 import dmd.Loc;
 import dmd.TOK;
 import dmd.TypeFunction;
+import dmd.GlobalExpressions : initGlobalExpressions;
 
 import dmd.codegen.Util;
 import dmd.backend.elem;
@@ -198,6 +199,8 @@
 	{
 	    register();
 
+	    initGlobalExpressions();
+
 		params.versionids = new Vector!(string)();
 		params.imppath = new Array();
 
--- a/dmd/GlobalExpressions.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/GlobalExpressions.d	Sat Mar 02 01:25:52 2013 -0800
@@ -2,22 +2,20 @@
 
 import dmd.common;
 import dmd.Expression;
+import dmd.Loc;
+import dmd.TOK;
 
-__gshared Expression EXP_CANT_INTERPRET = castToExpression(1);
-__gshared Expression EXP_CONTINUE_INTERPRET = castToExpression(2);
-__gshared Expression EXP_BREAK_INTERPRET = castToExpression(3);
-__gshared Expression EXP_GOTO_INTERPRET = castToExpression(4);
-__gshared Expression EXP_VOID_INTERPRET = castToExpression(5);
+__gshared Expression EXP_CANT_INTERPRET;
+__gshared Expression EXP_CONTINUE_INTERPRET;
+__gshared Expression EXP_BREAK_INTERPRET;
+__gshared Expression EXP_GOTO_INTERPRET;
+__gshared Expression EXP_VOID_INTERPRET;
 
-Expression castToExpression(int i)
+void initGlobalExpressions()
 {
-	union U
-	{
-		int i;
-		Expression e;
-	}
-	
-	U u;
-	u.i = i;
-	return u.e;
+	EXP_CANT_INTERPRET = new Expression(Loc(0), TOK.init, 0);
+	EXP_CONTINUE_INTERPRET = new Expression(Loc(0), TOK.init, 0);
+	EXP_BREAK_INTERPRET = new Expression(Loc(0), TOK.init, 0);
+	EXP_GOTO_INTERPRET = new Expression(Loc(0), TOK.init, 0);
+	EXP_VOID_INTERPRET = new Expression(Loc(0), TOK.init, 0);
 }
\ No newline at end of file
--- a/dmd/Library.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/Library.d	Sat Mar 02 01:25:52 2013 -0800
@@ -21,9 +21,9 @@
 
 import core.memory;
 
-align(1)
 struct LibHeader
 {
+align(1):
 	ubyte  recTyp;      // 0xF0
 	ushort pagesize;
 	int    lSymSeek;
@@ -31,9 +31,9 @@
 	ubyte  flags;
 }
 
-align(1)
 struct Libheader
 {
+align(1):
 	ubyte recTyp;
 	ushort recLen;
 	int trailerPosn;
--- a/dmd/NewExp.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/NewExp.d	Sat Mar 02 01:25:52 2013 -0800
@@ -387,7 +387,7 @@
 		return this;
 	}
 	
-    Expression interpret(InterState istate)
+    override Expression interpret(InterState istate)
 	{
 version (LOG) {
 		writef("NewExp::interpret() %s\n", toChars());
--- a/dmd/SharedStaticCtorDeclaration.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/SharedStaticCtorDeclaration.d	Sat Mar 02 01:25:52 2013 -0800
@@ -18,18 +18,18 @@
 		super(loc, endloc, "_sharedStaticCtor");
 	}
 	
-    Dsymbol syntaxCopy(Dsymbol s)
+    override Dsymbol syntaxCopy(Dsymbol s)
 	{
 		assert(!s);
 		SharedStaticCtorDeclaration scd = new SharedStaticCtorDeclaration(loc, endloc);
 		return FuncDeclaration.syntaxCopy(scd);
 	}
 	
-    void toCBuffer(OutBuffer buf, HdrGenState* hgs)
+    override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
 	{
 		buf.writestring("shared ");
 		StaticCtorDeclaration.toCBuffer(buf, hgs);
 	}
 
-    SharedStaticCtorDeclaration isSharedStaticCtorDeclaration() { return this; }
+    override SharedStaticCtorDeclaration isSharedStaticCtorDeclaration() { return this; }
 }
\ No newline at end of file
--- a/dmd/SharedStaticDtorDeclaration.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/SharedStaticDtorDeclaration.d	Sat Mar 02 01:25:52 2013 -0800
@@ -18,14 +18,14 @@
 	    super(loc, endloc, "_sharedStaticDtor");
 	}
 	
-    Dsymbol syntaxCopy(Dsymbol s)
+    override Dsymbol syntaxCopy(Dsymbol s)
 	{
 		assert(!s);
 		SharedStaticDtorDeclaration sdd = new SharedStaticDtorDeclaration(loc, endloc);
 		return FuncDeclaration.syntaxCopy(sdd);
 	}
 	
-    void toCBuffer(OutBuffer buf, HdrGenState* hgs)
+    override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
 	{
 	    if (!hgs.hdrgen)
 		{
@@ -34,5 +34,5 @@
 		}
 	}
 
-    SharedStaticDtorDeclaration isSharedStaticDtorDeclaration() { return this; }
+    override SharedStaticDtorDeclaration isSharedStaticDtorDeclaration() { return this; }
 }
\ No newline at end of file
--- a/dmd/SymOffExp.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/SymOffExp.d	Sat Mar 02 01:25:52 2013 -0800
@@ -61,7 +61,7 @@
 		return this;
 	}
 	
-    Expression interpret(InterState istate)
+    override Expression interpret(InterState istate)
 	{
 version (LOG) {
 		writef("SymOffExp::interpret() %s\n", toChars());
--- a/dmd/backend/iasm.d	Sun Mar 25 03:11:12 2012 +0400
+++ b/dmd/backend/iasm.d	Sat Mar 02 01:25:52 2013 -0800
@@ -1389,7 +1389,8 @@
 			size_t len = id.length;
 			if (len < 20)
 			{
-				ASMTK asmtk = cast(ASMTK) binary(toStringz(id), apszAsmtk.ptr, ASMTK.ASMTKmax);
+				ASMTK asmtk = cast(ASMTK) binary(toStringz(id), apszAsmtk, ASMTK.ASMTKmax);
+				
 				if (cast(int)asmtk >= 0)
 					tok_value = cast(TOK)(asmtk + TOK.TOKMAX + 1);
 			}