diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-02-06 22:03:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-02-06 22:03:46 +0000 |
| commit | 4ecd2d01255612f26fb89d65b90e3672eea3e263 (patch) | |
| tree | f01a5372b7946d9be01c39b2644ea9df9de641fb /llvm/lib/Transforms/IPO/PoolAllocate.cpp | |
| parent | 4fdb75f22356e8065a04808ffdb4ad7f2661ebc4 (diff) | |
| download | bcm5719-llvm-4ecd2d01255612f26fb89d65b90e3672eea3e263.tar.gz bcm5719-llvm-4ecd2d01255612f26fb89d65b90e3672eea3e263.zip | |
Fix a problem Sumant was running into
llvm-svn: 5499
Diffstat (limited to 'llvm/lib/Transforms/IPO/PoolAllocate.cpp')
| -rw-r--r-- | llvm/lib/Transforms/IPO/PoolAllocate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/PoolAllocate.cpp b/llvm/lib/Transforms/IPO/PoolAllocate.cpp index 894dbf315c3..b2efc12de27 100644 --- a/llvm/lib/Transforms/IPO/PoolAllocate.cpp +++ b/llvm/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. |

