comparison 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
comparison
equal deleted inserted replaced
1277:6bd5ce91b136 1278:8fb39f7f1a7c
126 } 126 }
127 127
128 // file param 128 // file param
129 129
130 // we might be generating for an imported template function 130 // we might be generating for an imported template function
131 IrModule* irmod = getIrModule(M); 131 const char* cur_file = M->srcfile->name->toChars();
132 132 if (loc.filename && strcmp(loc.filename, cur_file) != 0)
133 args.push_back(DtoLoad(irmod->fileName)); 133 {
134 args.push_back(DtoConstString(loc.filename));
135 }
136 else
137 {
138 IrModule* irmod = getIrModule(M);
139 args.push_back(DtoLoad(irmod->fileName));
140 }
134 141
135 // line param 142 // line param
136 LLConstant* c = DtoConstUint(loc.linnum); 143 LLConstant* c = DtoConstUint(loc.linnum);
137 args.push_back(c); 144 args.push_back(c);
138 145
792 vd->codegen(Type::sir); 799 vd->codegen(Type::sir);
793 800
794 if (vd->ir.initialized) return; 801 if (vd->ir.initialized) return;
795 vd->ir.initialized = gIR->dmodule; 802 vd->ir.initialized = gIR->dmodule;
796 803
797 Logger::println("DtoConstInitGlobal(%s) @ %s", vd->toChars(), vd->locToChars()); 804 Logger::println("DtoConstInitGlobal(%s) @ %s", vd->toChars(), vd->loc.toChars());
798 LOG_SCOPE; 805 LOG_SCOPE;
799 806
800 Dsymbol* par = vd->toParent(); 807 Dsymbol* par = vd->toParent();
801 808
802 // build the initializer 809 // build the initializer