summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2018-09-21 21:20:33 +0000
committerRichard Trieu <rtrieu@google.com>2018-09-21 21:20:33 +0000
commit5061e832952f7c67958240016ef33756f5a38e62 (patch)
treee50a91e118b2ae5abcb4a63c50b03c840b4d4252 /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parenteabc582b62f4a3935e643cfe55482a9958421b72 (diff)
downloadbcm5719-llvm-5061e832952f7c67958240016ef33756f5a38e62.tar.gz
bcm5719-llvm-5061e832952f7c67958240016ef33756f5a38e62.zip
Make compare function in r342648 have strict weak ordering.
Comparison functions used in sorting algorithms need to have strict weak ordering. Remove the assert and allow comparisons on all lists. llvm-svn: 342774
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 2f60d4d981d..01012cb3e91 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -7607,8 +7607,15 @@ public:
SI->getAssociatedDeclaration())
break;
}
- assert(CI != CE && SI != SE &&
- "Unexpected end of the map components.");
+
+ // Lists contain the same elements.
+ if (CI == CE && SI == SE)
+ return false;
+
+ // List with less elements is less than list with more elements.
+ if (CI == CE || SI == SE)
+ return CI == CE;
+
const auto *FD1 = cast<FieldDecl>(CI->getAssociatedDeclaration());
const auto *FD2 = cast<FieldDecl>(SI->getAssociatedDeclaration());
if (FD1->getParent() == FD2->getParent())
OpenPOWER on IntegriCloud