From 885a805d26e3b81d3eedc163f1ab2c9b9066cb85 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Fri, 1 Aug 2008 21:54:40 +0200 Subject: [PATCH] Fixed problem where global variables did not resolve type before using it. --- gen/functions.cpp | 11 +++++++++++ gen/structs.cpp | 3 +++ 2 files changed, 14 insertions(+) diff --git a/gen/functions.cpp b/gen/functions.cpp index e23643b4..27258142 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -589,10 +589,21 @@ void DtoDefineFunc(FuncDeclaration* fd) // 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; diff --git a/gen/structs.cpp b/gen/structs.cpp index fc693cbe..37dbde60 100644 --- a/gen/structs.cpp +++ b/gen/structs.cpp @@ -23,8 +23,11 @@ LLConstant* DtoConstStructInitializer(StructInitializer* si) 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';