summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-01-23 15:21:44 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-01-23 15:21:44 +0000
commitc4231cc9b3e44e2a2bf2d923955762b027ed03c6 (patch)
tree865f3cff34e436cc20dce7415c4ae0a3919f5d84
parentc142874c9c5db77408114b58fda7b32e43d5dc9a (diff)
downloadbcm5719-llvm-c4231cc9b3e44e2a2bf2d923955762b027ed03c6.tar.gz
bcm5719-llvm-c4231cc9b3e44e2a2bf2d923955762b027ed03c6.zip
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
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index b3ab9fc9d02..2699cea8f66 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -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,
OpenPOWER on IntegriCloud