[OPENMP50]Fix scoring of contexts with and without user provided scores.
The context selector with user provided score must have higher score
than the context selector without user provided score.
llvm-svn: 374224
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index d2f18a5..2ad6d01 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -11187,7 +11187,7 @@
return false;
llvm::APSInt LHSVal = LHS->EvaluateKnownConstInt(Ctx);
llvm::APSInt RHSVal = RHS->EvaluateKnownConstInt(Ctx);
- return llvm::APSInt::compareValues(LHSVal, RHSVal) <= 0;
+ return llvm::APSInt::compareValues(LHSVal, RHSVal) >= 0;
}
namespace {
@@ -11250,7 +11250,7 @@
}
// If the attribute matches the context, find the attribute with the highest
// score.
- if (SelectedAttr && (!TopMostAttr || Comparer(TopMostAttr, SelectedAttr)))
+ if (SelectedAttr && (!TopMostAttr || !Comparer(TopMostAttr, SelectedAttr)))
TopMostAttr = SelectedAttr;
}
if (!TopMostAttr)