aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-06 22:03:46 +0000
committerChris Lattner <sabre@nondot.org>2003-02-06 22:03:46 +0000
commit617d92c7d9ff41fc3588d710a8f7aae73f9bdb0f (patch)
tree47d6a6d2ac55ea1a6626cb9b310075063ff69428 /lib
parent9798ca55e1c5e07b175dbb7bbae3b50dbffeec94 (diff)
Fix a problem Sumant was running into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/IPO/PoolAllocate.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/PoolAllocate.cpp b/lib/Transforms/IPO/PoolAllocate.cpp
index 894dbf315c..b2efc12de2 100644
--- a/lib/Transforms/IPO/PoolAllocate.cpp
+++ b/lib/Transforms/IPO/PoolAllocate.cpp
@@ -46,7 +46,7 @@ bool PoolAllocate::run(Module &M) {
std::map<Function*, Function*> FuncMap;
// Loop over only the function initially in the program, don't traverse newly
- // added ones. If the function uses memory, make it's clone.
+ // added ones. If the function uses memory, make its clone.
Module::iterator LastOrigFunction = --M.end();
for (Module::iterator I = M.begin(); ; ++I) {
if (!I->isExternal())
@@ -132,7 +132,9 @@ Function *PoolAllocate::MakeFunctionClone(Function &F) {
Nodes[i]->markReachableNodes(MarkedNodes);
// Marked the returned node as alive...
- G.getRetNode().getNode()->markReachableNodes(MarkedNodes);
+ if (DSNode *RetNode = G.getRetNode().getNode())
+ if (RetNode->NodeType & DSNode::HeapNode)
+ RetNode->markReachableNodes(MarkedNodes);
if (MarkedNodes.empty()) // We don't need to clone the function if there
return 0; // are no incoming arguments to be added.