diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-11-05 15:33:18 -0500 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-11-05 15:59:22 -0500 |
commit | dcec2ac4f353c3813f45392dbd0b4d3c5ee66e06 (patch) | |
tree | 61c9ea33edbb83d74d255f172574f82d38a3c1b4 /clang/lib/Sema/SemaOpenMP.cpp | |
parent | a078c77d72082bf6a06486849735cdeaab1374bc (diff) | |
download | bcm5719-llvm-dcec2ac4f353c3813f45392dbd0b4d3c5ee66e06.tar.gz bcm5719-llvm-dcec2ac4f353c3813f45392dbd0b4d3c5ee66e06.zip |
[OPENMP50]Simplify processing of context selector scores.
If the context selector score was not specified, its value must be set
to 0. Simplify the processing of unspecified scores + save memory in
attribute representation.
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 9055eff872a..7ed582f8446 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -5197,9 +5197,7 @@ void Sema::ActOnOpenMPDeclareVariantDirective( Data.Ctx == OMPDeclareVariantAttr::CtxUnknown) return; Expr *Score = nullptr; - OMPDeclareVariantAttr::ScoreType ST = OMPDeclareVariantAttr::ScoreUnknown; if (Data.CtxScore.isUsable()) { - ST = OMPDeclareVariantAttr::ScoreSpecified; Score = Data.CtxScore.get(); if (!Score->isTypeDependent() && !Score->isValueDependent() && !Score->isInstantiationDependent() && @@ -5209,9 +5207,11 @@ void Sema::ActOnOpenMPDeclareVariantDirective( if (ICE.isInvalid()) return; } + } else { + Score = ActOnIntegerConstant(SourceLocation(), 0).get(); } auto *NewAttr = OMPDeclareVariantAttr::CreateImplicit( - Context, VariantRef, Score, Data.CtxSet, ST, Data.Ctx, + Context, VariantRef, Score, Data.CtxSet, Data.Ctx, Data.ImplVendors.begin(), Data.ImplVendors.size(), SR); FD->addAttr(NewAttr); } |