# HG changeset patch # User Tomas Lindquist Olsen # Date 1217620480 -7200 # Node ID 56265fa07c7d33afcfd19b133e300004e1a9128a # Parent f7259fa1349c0a15c9e74217bc07cbd133945639 Fixed problem where global variables did not resolve type before using it. diff -r f7259fa1349c -r 56265fa07c7d gen/functions.cpp --- 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; diff -r f7259fa1349c -r 56265fa07c7d gen/structs.cpp --- 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';