[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
Wed Jul 27 02:00:00 PDT 2022


DavidSpickett updated this revision to Diff 447957.
DavidSpickett added a comment.

Always check for 1 item.


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.447957.patch
Type: text/x-patch
Size: 804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/08be8e26/attachment.bin>


More information about the llvm-commits mailing list