If adding a link to a collapsed, node, ignore offset.
[oota-llvm.git] / lib / Analysis / DataStructure / DataStructure.cpp
index 7fabdf21238606988a70234a3aa4bb8c7edd89f5..565a596b7cd61c12386bcb1b37672c75114745b1 100644 (file)
@@ -701,6 +701,9 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
 void DSNode::addEdgeTo(unsigned Offset, const DSNodeHandle &NH) {
   if (NH.isNull()) return;       // Nothing to do
 
+  if (isNodeCompletelyFolded())
+    Offset = 0;
+
   DSNodeHandle &ExistingEdge = getLink(Offset);
   if (!ExistingEdge.isNull()) {
     // Merge the two nodes...