changeset 740:96484f5bf5af

Automated merge with http://hg.dsource.org/projects/ldc
author Christian Kamm <kamm incasoftware de>
date Thu, 30 Oct 2008 10:17:05 +0100
parents 041c1596d217 (current diff) 1ae94fb1dbbd (diff)
children 4ac97ec7c18e
files
diffstat 4 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/mtype.c	Tue Oct 28 15:41:09 2008 +0100
+++ b/dmd/mtype.c	Thu Oct 30 10:17:05 2008 +0100
@@ -3454,7 +3454,7 @@
 	    }
 	}
 	if (t->ty == Ttuple)
-	    *pt = t;
+	    *pt = t->syntaxCopy();
 	else
 	    *pt = t->merge();
     }
--- a/gen/functions.cpp	Tue Oct 28 15:41:09 2008 +0100
+++ b/gen/functions.cpp	Thu Oct 30 10:17:05 2008 +0100
@@ -203,16 +203,18 @@
             // pass first param in EAX if it fits, is not floating point and is not a 3 byte struct.
             // FIXME: struct are not passed in EAX yet
 
+            int n_inreg = f->reverseParams ? n - 1 : 0;
+            Argument* arg = Argument::getNth(f->parameters, n_inreg);
+
             // if there is a implicit context parameter, pass it in EAX
             if (usesthis || usesnest)
             {
                 f->thisAttrs |= llvm::Attribute::InReg;
+                assert((!arg || (arg->llvmAttrs & llvm::Attribute::InReg) == 0) && "can't have two inreg args!");
             }
             // otherwise check the first formal parameter
             else
             {
-                int inreg = f->reverseParams ? n - 1 : 0;
-                Argument* arg = Argument::getNth(f->parameters, inreg);
                 Type* t = arg->type->toBasetype();
 
                 // 32bit ints, pointers, classes, static arrays and AAs
@@ -223,6 +225,7 @@
                     (t->size() <= PTRSIZE))
                 {
                     arg->llvmAttrs |= llvm::Attribute::InReg;
+                    assert((f->thisAttrs & llvm::Attribute::InReg) == 0 && "can't have two inreg args!");
                 }
             }
         }
--- a/premake.lua	Tue Oct 28 15:41:09 2008 +0100
+++ b/premake.lua	Thu Oct 30 10:17:05 2008 +0100
@@ -39,7 +39,7 @@
 
 -- x86 ABI support
 X86_REVERSE_PARAMS = 1
-X86_PASS_IN_EAX = 0 --disabled for now
+X86_PASS_IN_EAX = 1
 
 -- D version - don't change these !!!
 DMDV1 = "1"
--- a/runtime/internal/util/string.d	Tue Oct 28 15:41:09 2008 +0100
+++ b/runtime/internal/util/string.d	Thu Oct 30 10:17:05 2008 +0100
@@ -26,7 +26,7 @@
     char* p = tmp.ptr + tmp.length;
 
     do {
-       *--p = (val % 10) + '0';
+       *--p = cast(char)((val % 10) + '0');
        } while (val /= 10);
 
     return tmp [cast(size_t)(p - tmp.ptr) .. $];