summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/DebugLoc.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-01 05:12:07 +0000
committerChris Lattner <sabre@nondot.org>2010-04-01 05:12:07 +0000
commitcf25a89bb711c8624f2d3d9b24d81bd6b6dcfaee (patch)
treef8420e9dfc36f0f0e04c488ff9f9881924e4e0aa /llvm/lib/VMCore/DebugLoc.cpp
parentdba4346e91b9b5d85707c320bdf31c98ce713f7f (diff)
downloadbcm5719-llvm-cf25a89bb711c8624f2d3d9b24d81bd6b6dcfaee.tar.gz
bcm5719-llvm-cf25a89bb711c8624f2d3d9b24d81bd6b6dcfaee.zip
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. llvm-svn: 100084
Diffstat (limited to 'llvm/lib/VMCore/DebugLoc.cpp')
-rw-r--r--llvm/lib/VMCore/DebugLoc.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/DebugLoc.cpp b/llvm/lib/VMCore/DebugLoc.cpp
index d9f533a9d60..f02ce57c3b0 100644
--- a/llvm/lib/VMCore/DebugLoc.cpp
+++ b/llvm/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;
+ }
}
OpenPOWER on IntegriCloud