Minor DVarValue refactoring.

This commit is contained in:
David Nadlinger
2013-06-06 20:37:33 +02:00
parent c7c1c25f15
commit 4369776b27

View File

@@ -43,15 +43,14 @@ LLValue* DVarValue::getLVal()
LLValue* DVarValue::getRVal()
{
assert(val);
Type* bt = type->toBasetype();
LLValue* tmp = val;
llvm::Value* storage = val;
if (var && isSpecialRefVar(var))
tmp = DtoLoad(tmp);
storage = DtoLoad(storage);
if (DtoIsPassedByRef(bt))
return tmp;
return DtoLoad(tmp);
if (DtoIsPassedByRef(type->toBasetype()))
return storage;
return DtoLoad(storage);
}
LLValue* DVarValue::getRefStorage()