[llvm-commits] [llvm] r100084 - /llvm/trunk/lib/VMCore/DebugLoc.cpp

Chris Lattner sabre at nondot.org
Wed Mar 31 22:12:07 PDT 2010


Author: lattner
Date: Thu Apr  1 00:12:07 2010
New Revision: 100084

URL: http://llvm.org/viewvc/llvm-project?rev=100084&view=rev
Log:
fix a bug in DebugRecVH::deleted/allUsesReplacedWith.  If an 
entry in the Scope+InlinedAt drops to a non-canonical form,
we need to reset the idx member of both VH's to 0.

Modified:
    llvm/trunk/lib/VMCore/DebugLoc.cpp

Modified: llvm/trunk/lib/VMCore/DebugLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/DebugLoc.cpp?rev=100084&r1=100083&r2=100084&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/DebugLoc.cpp (original)
+++ llvm/trunk/lib/VMCore/DebugLoc.cpp Thu Apr  1 00:12:07 2010
@@ -220,9 +220,10 @@
          "Mapping out of date");
   Ctx->ScopeInlinedAtIdx.erase(std::make_pair(OldScope, OldInlinedAt));
   
-  // Reset this VH to null.
+  // Reset this VH to null.  Drop both 'Idx' values to null to indicate that
+  // we're in non-canonical form now.
   setValPtr(0);
-  Idx = 0;
+  Entry.first.Idx = Entry.second.Idx = 0;
 }
 
 void DebugRecVH::allUsesReplacedWith(Value *NewVa) {
@@ -280,6 +281,8 @@
                                                    Entry.second.get(), Idx);
   // If NewVal already has an entry, this becomes a non-canonical reference,
   // just drop Idx to 0 to signify this.
-  if (NewIdx != Idx)
-    Idx = 0;
+  if (NewIdx != Idx) {
+    std::pair<DebugRecVH, DebugRecVH> &Entry=Ctx->ScopeInlinedAtRecords[-Idx-1];
+    Entry.first.Idx = Entry.second.Idx = 0;
+  }
 }





More information about the llvm-commits mailing list