changeset 449:56265fa07c7d

Fixed problem where global variables did not resolve type before using it.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Fri, 01 Aug 2008 21:54:40 +0200
parents f7259fa1349c
children 22a56b65872b
files gen/functions.cpp gen/structs.cpp
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gen/functions.cpp	Fri Aug 01 19:54:31 2008 +0200
+++ b/gen/functions.cpp	Fri Aug 01 21:54:40 2008 +0200
@@ -589,10 +589,21 @@
 
             // FIXME: llvm seems to want an alloca/byval for debug info
             if (!vd->needsStorage || vd->nestedref || vd->isRef() || vd->isOut())
+            {
+                Logger::println("skipping arg storage for (%s) %s ", vd->loc.toChars(), vd->toChars());
                 continue;
+            }
+            // static array params don't support debug info it seems
+            // probably because they're not passed byval
+            else if (vd->type->toBasetype()->ty == Tsarray)
+            {
+                Logger::println("skipping arg storage for static array (%s) %s ", vd->loc.toChars(), vd->toChars());
+                continue;
+            }
             // debug info for normal aggr params seem to work fine
             else if (DtoIsPassedByRef(vd->type))
             {
+                Logger::println("skipping arg storage for aggregate (%s) %s ", vd->loc.toChars(), vd->toChars());
                 if (global.params.symdebug)
                     DtoDwarfLocalVariable(vd->ir.getIrValue(), vd);
                 continue;
--- a/gen/structs.cpp	Fri Aug 01 19:54:31 2008 +0200
+++ b/gen/structs.cpp	Fri Aug 01 21:54:40 2008 +0200
@@ -23,8 +23,11 @@
     Logger::println("DtoConstStructInitializer: %s", si->toChars());
     LOG_SCOPE;
 
+    assert(si->ad);
     TypeStruct* ts = (TypeStruct*)si->ad->type;
 
+    DtoResolveDsymbol(si->ad);
+
     const llvm::StructType* structtype = isaStruct(ts->ir.type->get());
     Logger::cout() << "llvm struct type: " << *structtype << '\n';