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 | 79db55028c50a275f38264b11c2ae9bff5daa348 (patch) | |
tree | be138f2a5d1ea188babe89e3d8d37bdbd1098cb1 /llvm/lib/Analysis/DataStructure/NodeImpl.cpp | |
parent | 116dfdd6e190cf525aa6b25bf4d3717cadd45f7c (diff) | |
download | bcm5719-llvm-79db55028c50a275f38264b11c2ae9bff5daa348.tar.gz bcm5719-llvm-79db55028c50a275f38264b11c2ae9bff5daa348.zip |
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
llvm-svn: 2274
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/NodeImpl.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/NodeImpl.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/llvm/lib/Analysis/DataStructure/NodeImpl.cpp b/llvm/lib/Analysis/DataStructure/NodeImpl.cpp index 732ab6a9950..4451f6e59bb 100644 --- a/llvm/lib/Analysis/DataStructure/NodeImpl.cpp +++ b/llvm/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) |