[PATCH] D149045: [Assignment Tracking] Fix faulty assertion inside std::sort predicate
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 26 03:15:21 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb59d672ed489: [Assignment Tracking] Fix faulty assertion inside std::sort predicate (authored by Orlando).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149045/new/
https://reviews.llvm.org/D149045
Files:
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
Index: llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
===================================================================
--- llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -2011,16 +2011,17 @@
}
}
- // Sort the fragment map for each DebugAggregate in non-descending
- // order of fragment size. Assert no entries are duplicates.
+ // Sort the fragment map for each DebugAggregate in ascending
+ // order of fragment size - there should be no duplicates.
for (auto &Pair : FragmentMap) {
SmallVector<DebugVariable, 8> &Frags = Pair.second;
- std::sort(
- Frags.begin(), Frags.end(), [](DebugVariable Next, DebugVariable Elmt) {
- assert(!(Elmt.getFragmentOrDefault() == Next.getFragmentOrDefault()));
- return Elmt.getFragmentOrDefault().SizeInBits >
- Next.getFragmentOrDefault().SizeInBits;
- });
+ std::sort(Frags.begin(), Frags.end(),
+ [](const DebugVariable &Next, const DebugVariable &Elmt) {
+ return Elmt.getFragmentOrDefault().SizeInBits >
+ Next.getFragmentOrDefault().SizeInBits;
+ });
+ // Check for duplicates.
+ assert(std::adjacent_find(Frags.begin(), Frags.end()) == Frags.end());
}
// Build the map.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149045.517111.patch
Type: text/x-patch
Size: 1328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230426/8af3634a/attachment.bin>
More information about the llvm-commits
mailing list