mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-12 06:49:02 +02:00
Fixed calling of _d_array_bounds and _d_switch_error.
This commit is contained in:
@@ -1327,9 +1327,15 @@ void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, bool isslice)
|
||||
|
||||
std::vector<LLValue*> args;
|
||||
|
||||
Module* funcmodule = gIR->func()->decl->getModule();
|
||||
#if DMDV2
|
||||
// module param
|
||||
LLValue *moduleInfoSymbol = funcmodule->moduleInfoSymbol();
|
||||
const LLType *moduleInfoType = DtoType(Module::moduleinfo->type);
|
||||
args.push_back(DtoBitCast(moduleInfoSymbol, getPtrToType(moduleInfoType)));
|
||||
#else
|
||||
// file param
|
||||
// we might be generating for an imported template function
|
||||
Module* funcmodule = gIR->func()->decl->getModule();
|
||||
const char* cur_file = funcmodule->srcfile->name->toChars();
|
||||
if (loc.filename && strcmp(loc.filename, cur_file) != 0)
|
||||
{
|
||||
@@ -1340,6 +1346,7 @@ void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, bool isslice)
|
||||
IrModule* irmod = getIrModule(funcmodule);
|
||||
args.push_back(DtoLoad(irmod->fileName));
|
||||
}
|
||||
#endif
|
||||
|
||||
// line param
|
||||
LLConstant* c = DtoConstUint(loc.linnum);
|
||||
|
||||
Reference in New Issue
Block a user