diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-09 20:54:06 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-09 20:54:06 +0000 |
commit | bfd19c31688ed4dc1dd5bbe9cccc8b1e243d925c (patch) | |
tree | 5c0f03fe29cf6c83e92e53e57958efef4fe6e2f5 /lib | |
parent | 7823560840f75b2a59347a03c422783d0dd913f4 (diff) | |
download | clang-bfd19c31688ed4dc1dd5bbe9cccc8b1e243d925c.tar.gz |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/CGOpenMPRuntime.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index d2f18a5767..2ad6d01fda 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -11187,7 +11187,7 @@ static bool greaterCtxScore(ASTContext &Ctx, const Expr *LHS, const Expr *RHS) { 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 @@ static const FunctionDecl *getDeclareVariantFunction(ASTContext &Ctx, } // 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) |