From 67fcdf7f6579fcc070f019096cedf80d5a834554 Mon Sep 17 00:00:00 2001 From: David Greene Date: Tue, 10 Jul 2007 22:00:30 +0000 Subject: [PATCH] Make this work with GLIBCXX_DEBUG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38516 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/BranchFolding.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index d0dcc708d06..431bc4eca35 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -429,8 +429,15 @@ static bool MergeCompare(const std::pair &p, return true; else if (p.second->getNumber() > q.second->getNumber()) return false; - else + else { + // _GLIBCXX_DEBUG needs to check strict weak ordering and it + // does it by doing a compare on the same object. +#ifdef _GLIBCXX_DEBUG + return(false); +#else assert(0 && "Predecessor appears twice"); +#endif + } } // See if any of the blocks in MergePotentials (which all have a common single