[llvm] r215418 - DebugLocEntry: Restore the comparison predicate from before the

Adrian Prantl aprantl at apple.com
Mon Aug 11 18:07:53 PDT 2014


Author: adrian
Date: Mon Aug 11 20:07:53 2014
New Revision: 215418

URL: http://llvm.org/viewvc/llvm-project?rev=215418&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h
    llvm/trunk/test/DebugInfo/X86/pieces-3.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h?rev=215418&r1=215417&r2=215418&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h Mon Aug 11 20:07:53 2014
@@ -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());
   }
 };
 

Modified: llvm/trunk/test/DebugInfo/X86/pieces-3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/pieces-3.ll?rev=215418&r1=215417&r2=215418&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/pieces-3.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/pieces-3.ll Mon Aug 11 20:07:53 2014
@@ -44,6 +44,7 @@ define i32 @foo(i64 %outer.coerce0, i64
   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





More information about the llvm-commits mailing list