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
diff --git a/lib/Analysis/DataStructure/NodeImpl.cpp b/lib/Analysis/DataStructure/NodeImpl.cpp
index 732ab6a..4451f6e 100644
--- a/lib/Analysis/DataStructure/NodeImpl.cpp
+++ b/lib/Analysis/DataStructure/NodeImpl.cpp
@@ -208,6 +208,13 @@
          "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 @@
   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 @@
   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)