diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-03 20:08:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-03 20:08:51 +0000 |
commit | 1d3922ac0bd2e5d357c91a5039bdf4221b065b1d (patch) | |
tree | 1304905473397271f7131d2ce498fb915b5a439e /llvm/lib/Analysis/DataStructure/DataStructure.cpp | |
parent | 47c8d718a6b08b23a808abdf7560ebe0cb24d1f5 (diff) | |
download | bcm5719-llvm-1d3922ac0bd2e5d357c91a5039bdf4221b065b1d.tar.gz bcm5719-llvm-1d3922ac0bd2e5d357c91a5039bdf4221b065b1d.zip |
* Fix a bug introduced in the last checkin wrt Stack markers
* Make cloning more efficient in the process...
llvm-svn: 5479
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/DataStructure.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp index 818ca3781fc..80c64d126c6 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp @@ -599,10 +599,15 @@ DSNodeHandle DSGraph::cloneInto(const DSGraph &G, // Duplicate all of the nodes, populating the node map... Nodes.reserve(FN+G.Nodes.size()); + + // Remove alloca or mod/ref bits as specified... + unsigned clearBits = (CloneFlags & StripAllocaBit ? DSNode::AllocaNode : 0) + | (CloneFlags & StripModRefBits ? (DSNode::Modified | DSNode::Read) : 0); + clearBits |= DSNode::DEAD; // Clear dead flag... for (unsigned i = 0, e = G.Nodes.size(); i != e; ++i) { DSNode *Old = G.Nodes[i]; DSNode *New = new DSNode(*Old); - New->NodeType &= ~DSNode::DEAD; // Clear dead flag... + New->NodeType &= ~clearBits; Nodes.push_back(New); OldNodeMap[Old] = New; } @@ -615,13 +620,6 @@ DSNodeHandle DSGraph::cloneInto(const DSGraph &G, for (unsigned i = FN, e = Nodes.size(); i != e; ++i) Nodes[i]->remapLinks(OldNodeMap); - // Remove alloca markers as specified - if (CloneFlags & (StripAllocaBit | StripModRefBits)) { - unsigned clearBits = (CloneFlags & StripAllocaBit ? DSNode::AllocaNode : 0) - | (CloneFlags & StripModRefBits ? (DSNode::Modified | DSNode::Read) : 0); - maskNodeTypes(~clearBits); - } - // Copy the scalar map... merging all of the global nodes... for (hash_map<Value*, DSNodeHandle>::const_iterator I = G.ScalarMap.begin(), E = G.ScalarMap.end(); I != E; ++I) { |