Mercurial > projects > ldc
diff gen/llvmhelpers.cpp @ 1278:8fb39f7f1a7c
Fixed file name in imported mixins containing assertions.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Wed, 29 Apr 2009 18:39:59 +0200 |
parents | 0686701178d3 |
children | 04c36605feb9 |
line wrap: on
line diff
--- 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();