DMD Issue 4523 - [tdpl] .remove method for Associative Arrays returns void in all cases

This commit is contained in:
Alexey Prokhin
2012-02-13 14:05:28 +04:00
parent 6fea4b65a2
commit fa361ed598
4 changed files with 15 additions and 9 deletions

View File

@@ -191,7 +191,7 @@ DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key)
/////////////////////////////////////////////////////////////////////////////////////
void DtoAARemove(Loc& loc, DValue* aa, DValue* key)
DValue *DtoAARemove(Loc& loc, DValue* aa, DValue* key)
{
// D1:
// call:
@@ -199,7 +199,7 @@ void DtoAARemove(Loc& loc, DValue* aa, DValue* key)
// D2:
// call:
// extern(C) void _aaDelX(AA aa, TypeInfo keyti, void* pkey)
// extern(C) bool _aaDelX(AA aa, TypeInfo keyti, void* pkey)
// first get the runtime function
#if DMDV2
@@ -240,7 +240,13 @@ void DtoAARemove(Loc& loc, DValue* aa, DValue* key)
args.push_back(pkey);
// call runtime
gIR->CreateCallOrInvoke(func, args);
LLCallSite call = gIR->CreateCallOrInvoke(func, args);
#if DMDV2
return new DImValue(Type::tbool, call.getInstruction());
#else
return NULL;
#endif
}
/////////////////////////////////////////////////////////////////////////////////////