mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 22:50:53 +03:00
Call _d_arraybounds for bounds checking instead of _d_array_bounds.
It expects file name as a first argument instead of pointer to Module.
This commit is contained in:
parent
000663e27e
commit
76f3fd02bd
5 changed files with 33 additions and 27 deletions
|
@ -188,18 +188,7 @@ void DtoAssert(Module* M, Loc& loc, DValue* msg)
|
|||
}
|
||||
|
||||
// file param
|
||||
|
||||
// we might be generating for an imported template function
|
||||
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));
|
||||
}
|
||||
args.push_back(DtoModuleFileName(M, loc));
|
||||
|
||||
// line param
|
||||
args.push_back(DtoConstUint(loc.linnum));
|
||||
|
@ -214,6 +203,25 @@ void DtoAssert(Module* M, Loc& loc, DValue* msg)
|
|||
gIR->ir->CreateUnreachable();
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Module file name
|
||||
////////////////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
LLValue *DtoModuleFileName(Module* M, const Loc& loc)
|
||||
{
|
||||
// we might be generating for an imported template function
|
||||
const char* cur_file = M->srcfile->name->toChars();
|
||||
if (loc.filename && strcmp(loc.filename, cur_file) != 0)
|
||||
{
|
||||
return DtoConstString(loc.filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
IrModule* irmod = getIrModule(M);
|
||||
return DtoLoad(irmod->fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue