diff gen/tollvm.cpp @ 144:a27941d00351 trunk

[svn r149] fixed: a bunch of D-style variadics problems. fixed: GotoDefaultStatement implemented. fixed: some other minor bugs.
author lindquist
date Sat, 26 Jan 2008 17:13:22 +0100
parents a123dca8349b
children 4c577c2b7229
line wrap: on
line diff
--- a/gen/tollvm.cpp	Fri Jan 25 01:42:36 2008 +0100
+++ b/gen/tollvm.cpp	Sat Jan 26 17:13:22 2008 +0100
@@ -346,13 +346,16 @@
 
 llvm::GlobalValue::LinkageTypes DtoLinkage(PROT prot, uint stc)
 {
+    // turns out we can't really make anything internal with the way D works :(
+    // the things we can need much more info than this can extract.
+    // TODO : remove this useless function
     switch(prot)
     {
     case PROTprivate:
-        if (stc & STCextern)
+        //if (stc & STCextern)
             return llvm::GlobalValue::ExternalLinkage;
-        else
-            return llvm::GlobalValue::InternalLinkage;
+        //else
+        //    return llvm::GlobalValue::InternalLinkage;
 
     case PROTpublic:
     case PROTpackage:
@@ -902,7 +905,12 @@
         }
     }
     else if (t->ty == Tsarray) {
-        DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal());
+        if (DtoType(lhs->getType()) == DtoType(rhs->getType())) {
+            DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal());
+        }
+        else {
+            DtoArrayInit(lhs->getLVal(), rhs->getRVal());
+        }
     }
     else if (t->ty == Tdelegate) {
         if (rhs->isNull())