DebugLocEntry: Restore the comparison predicate from before the

refactoring in 215384. This way it can unique multiple entries describing
the same piece even if they don't have the exact same location.
(The same piece may get merged in and be added from OpenRanges).
There ought to be a more elegant solution for this, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215418 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl 2014-08-12 01:07:53 +00:00
parent 23761603fe
commit a6bd9bd30e
2 changed files with 5 additions and 1 deletions

View File

@ -131,7 +131,10 @@ public:
// Remove any duplicate entries by dropping all but the first.
void sortUniqueValues() {
std::sort(Values.begin(), Values.end());
Values.erase(std::unique(Values.begin(), Values.end()), Values.end());
Values.erase(std::unique(Values.begin(), Values.end(),
[](const Value &A, const Value &B) {
return A.getVariable() == B.getVariable();
}), Values.end());
}
};

View File

@ -44,6 +44,7 @@ define i32 @foo(i64 %outer.coerce0, i64 %outer.coerce1) #0 {
call void @llvm.dbg.value(metadata !{i32 %outer.sroa.1.8.extract.trunc}, i64 0, metadata !34), !dbg !33
%outer.sroa.1.12.extract.shift = lshr i64 %outer.coerce1, 32, !dbg !33
%outer.sroa.1.12.extract.trunc = trunc i64 %outer.sroa.1.12.extract.shift to i32, !dbg !33
call void @llvm.dbg.value(metadata !{i64 %outer.sroa.1.12.extract.shift}, i64 0, metadata !34), !dbg !33
call void @llvm.dbg.value(metadata !{i32 %outer.sroa.1.12.extract.trunc}, i64 0, metadata !34), !dbg !33
call void @llvm.dbg.declare(metadata !{null}, metadata !34), !dbg !33
ret i32 %outer.sroa.1.8.extract.trunc, !dbg !36