Eliminate the need for TypeFunction::funcdecl

This commit is contained in:
Alexey Prokhin
2013-10-01 14:00:28 +04:00
parent ca82589e25
commit b819975c84
22 changed files with 187 additions and 160 deletions

View File

@@ -1465,7 +1465,11 @@ DValue* PtrExp::toElem(IRState* p)
if (type->toBasetype()->ty == Tfunction)
{
assert(!cachedLvalue);
return new DImValue(type, e1->toElem(p)->getRVal());
DValue *dv = e1->toElem(p);
if (DFuncValue *dfv = dv->isFunc())
return new DFuncValue(type, dfv->func, dfv->getRVal());
else
return new DImValue(type, dv->getRVal());
}
// get the rvalue and return it as an lvalue
@@ -2798,7 +2802,7 @@ DValue* FuncExp::toElem(IRState* p)
return new DImValue(type, DtoAggrPair(cval, castfptr, ".func"));
} else {
return new DImValue(type, fd->ir.irFunc->func);
return new DFuncValue(type, fd, fd->ir.irFunc->func);
}
}