mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Fix a problem Sumant was running into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9798ca55e1
commit
617d92c7d9
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user