changeset 655:93433f4b6963

Added -version=Tango in default llvmdc.conf Fixed problem with array casts, all DWT modules needed for HelloWorld1 samples now compile. Still some linking issues.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 06 Oct 2008 12:46:57 +0200
parents 961221d5a49c
children a15ccbf7451d
files bin/llvmdc.conf gen/arrays.cpp llvmdc-tango
diffstat 3 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/bin/llvmdc.conf	Mon Oct 06 10:23:25 2008 +0200
+++ b/bin/llvmdc.conf	Mon Oct 06 12:46:57 2008 +0200
@@ -1,4 +1,4 @@
 
 [Environment]
 
-DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib
+DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib -version=Tango
--- a/gen/arrays.cpp	Mon Oct 06 10:23:25 2008 +0200
+++ b/gen/arrays.cpp	Mon Oct 06 12:46:57 2008 +0200
@@ -998,10 +998,12 @@
                 rval2 = DtoArrayCastLength(DtoArrayLen(usl), ety, ptrty->getContainedType(0));
         }
         else {
-            LLValue* uval = u->getRVal();
             if (fromtype->ty == Tsarray) {
+                LLValue* uval = u->getRVal();
+
                 if (Logger::enabled())
                     Logger::cout() << "uvalTy = " << *uval->getType() << '\n';
+
                 assert(isaPointer(uval->getType()));
                 const LLArrayType* arrty = isaArray(uval->getType()->getContainedType(0));
 
@@ -1016,15 +1018,10 @@
                 rval = DtoBitCast(uval, ptrty);
             }
             else {
-                LLValue* zero = llvm::ConstantInt::get(LLType::Int32Ty, 0, false);
-                LLValue* one = llvm::ConstantInt::get(LLType::Int32Ty, 1, false);
-                rval2 = DtoGEP(uval,zero,zero);
-                rval2 = DtoLoad(rval2);
+                rval2 = DtoArrayLen(u);
                 rval2 = DtoArrayCastLength(rval2, ety, ptrty->getContainedType(0));
 
-                rval = DtoGEP(uval,zero,one);
-                rval = DtoLoad(rval);
-                //Logger::cout() << *e->mem->getType() << '|' << *ptrty << '\n';
+                rval = DtoArrayPtr(u);
                 rval = DtoBitCast(rval, ptrty);
             }
         }
--- a/llvmdc-tango	Mon Oct 06 10:23:25 2008 +0200
+++ b/llvmdc-tango	Mon Oct 06 12:46:57 2008 +0200
@@ -32,7 +32,7 @@
 
 
 [compile]
-cmd=llvmdc -version=Tango -c $i
+cmd=llvmdc -c $i
 
 flag=$i
 incdir=-I$i