diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-17 03:24:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-17 03:24:59 +0000 |
commit | fe14568a8122b7c9b832795594b7bae11b2b6cc4 (patch) | |
tree | c2d0983f282515c1933de2a3226670d314372071 /lib/Analysis/DataStructure/NodeImpl.cpp | |
parent | a146183c2105911eade774490650389924dae524 (diff) |
Make data structure acurately get ALL edges, even loads of null fields of
nodes that are not shadow nodes
This fixes em3d to be _correct_ if not optimial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/NodeImpl.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/NodeImpl.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/Analysis/DataStructure/NodeImpl.cpp b/lib/Analysis/DataStructure/NodeImpl.cpp index 732ab6a995..4451f6e59b 100644 --- a/lib/Analysis/DataStructure/NodeImpl.cpp +++ b/lib/Analysis/DataStructure/NodeImpl.cpp @@ -208,6 +208,13 @@ void DSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap, const DSNode *Old) { "Cloned nodes do not have the same number of links!"); for (unsigned j = 0, je = FieldLinks.size(); j != je; ++j) MapPVS(FieldLinks[j], Old->FieldLinks[j], NodeMap); + + // Map our SynthNodes... + assert(SynthNodes.empty() && "Synthnodes already mapped?"); + SynthNodes.reserve(Old->SynthNodes.size()); + for (unsigned i = 0, e = Old->SynthNodes.size(); i != e; ++i) + SynthNodes.push_back(std::make_pair(Old->SynthNodes[i].first, + (ShadowDSNode*)NodeMap[Old->SynthNodes[i].second])); } AllocDSNode::AllocDSNode(AllocationInst *V) @@ -251,7 +258,7 @@ ShadowDSNode::ShadowDSNode(const Type *Ty, Module *M) : DSNode(ShadowNode, Ty) { ShadowParent = 0; } -ShadowDSNode::ShadowDSNode(const Type *Ty, Module *M, ShadowDSNode *ShadParent) +ShadowDSNode::ShadowDSNode(const Type *Ty, Module *M, DSNode *ShadParent) : DSNode(ShadowNode, Ty) { Mod = M; ShadowParent = ShadParent; @@ -264,20 +271,6 @@ std::string ShadowDSNode::getCaption() const { return OS.str(); } -void ShadowDSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap, - const DSNode *O) { - const ShadowDSNode *Old = (ShadowDSNode*)O; - DSNode::mapNode(NodeMap, Old); // Map base portions first... - - // Map our SynthNodes... - assert(SynthNodes.empty() && "Synthnodes already mapped?"); - SynthNodes.reserve(Old->SynthNodes.size()); - for (unsigned i = 0, e = Old->SynthNodes.size(); i != e; ++i) - SynthNodes.push_back(std::make_pair(Old->SynthNodes[i].first, - (ShadowDSNode*)NodeMap[Old->SynthNodes[i].second])); -} - - CallDSNode::CallDSNode(CallInst *ci) : DSNode(CallNode, ci->getType()), CI(ci) { unsigned NumPtrs = 0; for (unsigned i = 0, e = ci->getNumOperands(); i != e; ++i) |