# HG changeset patch # User Tomas Lindquist Olsen # Date 1241023199 -7200 # Node ID 8fb39f7f1a7ce3be75e3c8a91b44e48c4f3d7c61 # Parent 6bd5ce91b13602a668666afb58fd5a4a5e5aabcc Fixed file name in imported mixins containing assertions. diff -r 6bd5ce91b136 -r 8fb39f7f1a7c gen/llvmhelpers.cpp --- a/gen/llvmhelpers.cpp Wed Apr 29 17:47:24 2009 +0200 +++ b/gen/llvmhelpers.cpp Wed Apr 29 18:39:59 2009 +0200 @@ -128,9 +128,16 @@ // file param // we might be generating for an imported template function - IrModule* irmod = getIrModule(M); - - args.push_back(DtoLoad(irmod->fileName)); + const char* cur_file = M->srcfile->name->toChars(); + if (loc.filename && strcmp(loc.filename, cur_file) != 0) + { + args.push_back(DtoConstString(loc.filename)); + } + else + { + IrModule* irmod = getIrModule(M); + args.push_back(DtoLoad(irmod->fileName)); + } // line param LLConstant* c = DtoConstUint(loc.linnum); @@ -794,7 +801,7 @@ if (vd->ir.initialized) return; vd->ir.initialized = gIR->dmodule; - Logger::println("DtoConstInitGlobal(%s) @ %s", vd->toChars(), vd->locToChars()); + Logger::println("DtoConstInitGlobal(%s) @ %s", vd->toChars(), vd->loc.toChars()); LOG_SCOPE; Dsymbol* par = vd->toParent(); diff -r 6bd5ce91b136 -r 8fb39f7f1a7c gen/structs.cpp --- a/gen/structs.cpp Wed Apr 29 17:47:24 2009 +0200 +++ b/gen/structs.cpp Wed Apr 29 18:39:59 2009 +0200 @@ -30,7 +30,7 @@ sd->ir.resolved = true; // log what we're doing - Logger::println("Resolving struct type: %s (%s)", sd->toChars(), sd->locToChars()); + Logger::println("Resolving struct type: %s (%s)", sd->toChars(), sd->loc.toChars()); LOG_SCOPE; // make sure type exists diff -r 6bd5ce91b136 -r 8fb39f7f1a7c ir/irclass.cpp --- a/ir/irclass.cpp Wed Apr 29 17:47:24 2009 +0200 +++ b/ir/irclass.cpp Wed Apr 29 18:39:59 2009 +0200 @@ -252,7 +252,7 @@ ClassDeclaration* cd = aggrdecl->isClassDeclaration(); assert(cd && "invalid class aggregate"); - IF_LOG Logger::println("Building class default initializer %s @ %s", cd->toPrettyChars(), cd->locToChars()); + IF_LOG Logger::println("Building class default initializer %s @ %s", cd->toPrettyChars(), cd->loc.toChars()); LOG_SCOPE; IF_LOG Logger::println("Instance size: %u", cd->structsize); diff -r 6bd5ce91b136 -r 8fb39f7f1a7c ir/irtypeclass.cpp --- a/ir/irtypeclass.cpp Wed Apr 29 17:47:24 2009 +0200 +++ b/ir/irtypeclass.cpp Wed Apr 29 18:39:59 2009 +0200 @@ -226,7 +226,7 @@ const llvm::Type* IrTypeClass::buildType() { - IF_LOG Logger::println("Building class type %s @ %s", cd->toPrettyChars(), cd->locToChars()); + IF_LOG Logger::println("Building class type %s @ %s", cd->toPrettyChars(), cd->loc.toChars()); LOG_SCOPE; IF_LOG Logger::println("Instance size: %u", cd->structsize); diff -r 6bd5ce91b136 -r 8fb39f7f1a7c ir/irtypestruct.cpp --- a/ir/irtypestruct.cpp Wed Apr 29 17:47:24 2009 +0200 +++ b/ir/irtypestruct.cpp Wed Apr 29 18:39:59 2009 +0200 @@ -76,7 +76,7 @@ const llvm::Type* IrTypeStruct::buildType() { IF_LOG Logger::println("Building struct type %s @ %s", - sd->toPrettyChars(), sd->locToChars()); + sd->toPrettyChars(), sd->loc.toChars()); LOG_SCOPE; // if it's a forward declaration, all bets are off, stick with the opaque