[PATCH] D130156: [llvm] Fix some test failures with EXPENSIVE_CHECKS and libstdc++

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 01:53:55 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa0ccba5e192b: [llvm] Fix some test failures with EXPENSIVE_CHECKS and libstdc++ (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130156/new/

https://reviews.llvm.org/D130156

Files:
  llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h


Index: llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
+++ llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
@@ -214,6 +214,11 @@
   // Sort the pieces by offset.
   // Remove any duplicate entries by dropping all but the first.
   void sortUniqueValues() {
+    // Values is either 1 item that does not have a fragment, or many items
+    // that all do. No need to sort if the former and also prevents operator<
+    // being called on a non fragment item when _GLIBCXX_DEBUG is defined.
+    if (Values.size() == 1)
+      return;
     llvm::sort(Values);
     Values.erase(std::unique(Values.begin(), Values.end(),
                              [](const DbgValueLoc &A, const DbgValueLoc &B) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130156.448266.patch
Type: text/x-patch
Size: 804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220728/86f8a096/attachment.bin>


More information about the llvm-commits mailing list