diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-01 05:12:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-01 05:12:07 +0000 |
commit | 175edf2c78ca009bc7eb66fe513559155af0f454 (patch) | |
tree | 19dee06aab4c5fc62f3ff4155fa171b7081e1ec5 /lib/VMCore | |
parent | 73180c5355bff75b2d9b0e1349f0898e4e60fe89 (diff) | |
download | external_llvm-175edf2c78ca009bc7eb66fe513559155af0f454.zip external_llvm-175edf2c78ca009bc7eb66fe513559155af0f454.tar.gz external_llvm-175edf2c78ca009bc7eb66fe513559155af0f454.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/DebugLoc.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/VMCore/DebugLoc.cpp b/lib/VMCore/DebugLoc.cpp index d9f533a..f02ce57 100644 --- a/lib/VMCore/DebugLoc.cpp +++ b/lib/VMCore/DebugLoc.cpp @@ -220,9 +220,10 @@ void DebugRecVH::deleted() { "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 @@ void DebugRecVH::allUsesReplacedWith(Value *NewVa) { 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; + } } |