[llvm-commits] [llvm] r173267 - /llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
Benjamin Kramer
benny.kra at googlemail.com
Wed Jan 23 07:21:44 PST 2013
Author: d0k
Date: Wed Jan 23 09:21:44 2013
New Revision: 173267
URL: http://llvm.org/viewvc/llvm-project?rev=173267&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp?rev=173267&r1=173266&r2=173267&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp Wed Jan 23 09:21:44 2013
@@ -1027,9 +1027,11 @@
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,
More information about the llvm-commits
mailing list