1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

NVPTX: Stop leaking memory by using a managed constant instead of a new Argument.

This is still an egregious hack since we don't have a nice interface for this
kind of thing but should help the valgrind leak check buildbot to become green.

llvm-svn: 173267
This commit is contained in:
Benjamin Kramer 2013-01-23 15:21:44 +00:00
parent 753fed104a
commit 7cbfce9f41

View File

@ -1027,9 +1027,11 @@ NVPTXTargetLowering::LowerFormalArguments(SDValue Chain,
if (isABI || isKernel) {
// If ABI, load from the param symbol
SDValue Arg = getParamSymbol(DAG, idx);
Value *srcValue = new Argument(PointerType::get(ObjectVT.getTypeForEVT(
F->getContext()),
llvm::ADDRESS_SPACE_PARAM));
// Conjure up a value that we can get the address space from.
// FIXME: Using a constant here is a hack.
Value *srcValue = Constant::getNullValue(PointerType::get(
ObjectVT.getTypeForEVT(F->getContext()),
llvm::ADDRESS_SPACE_PARAM));
SDValue p = DAG.getLoad(ObjectVT, dl, Root, Arg,
MachinePointerInfo(srcValue), false, false,
false,