diff options
author | Mike Rice <michael.p.rice@intel.com> | 2024-06-24 13:37:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 13:37:49 -0700 |
commit | 5413a2bb843a3c71e0891aa5984afd63cd580dea (patch) | |
tree | 7259e7ffbf43150851b946344f4ac6b37ae109e3 /clang/lib/Parse/ParseOpenMP.cpp | |
parent | 313b1a8250d3cd742356cc71c36402b10d8b2e16 (diff) | |
download | llvm-5413a2bb843a3c71e0891aa5984afd63cd580dea.zip llvm-5413a2bb843a3c71e0891aa5984afd63cd580dea.tar.gz llvm-5413a2bb843a3c71e0891aa5984afd63cd580dea.tar.bz2 |
[clang][OpenMP] Fix error handling of the adjust_args clause (#94696)
Static verifier noticed the current code has logically dead code parsing
the clause where IsComma is assigned. Fix this and improve the error
message received when a bad adjust-op is specified.
This will now be handled like 'map' where a nice diagnostic is given
with the correct values, then parsing continues on the next clause
reducing unhelpful diagnostics.
Diffstat (limited to 'clang/lib/Parse/ParseOpenMP.cpp')
-rw-r--r-- | clang/lib/Parse/ParseOpenMP.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index 50a872f..76d1854 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -4785,8 +4785,8 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind, getLangOpts()); Data.ExtraModifierLoc = Tok.getLocation(); if (Data.ExtraModifier == OMPC_ADJUST_ARGS_unknown) { - SkipUntil(tok::colon, tok::r_paren, tok::annot_pragma_openmp_end, - StopBeforeMatch); + Diag(Tok, diag::err_omp_unknown_adjust_args_op); + SkipUntil(tok::r_paren, tok::annot_pragma_openmp_end, StopBeforeMatch); } else { ConsumeToken(); if (Tok.is(tok::colon)) @@ -4799,7 +4799,7 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind, bool IsComma = (Kind != OMPC_reduction && Kind != OMPC_task_reduction && Kind != OMPC_in_reduction && Kind != OMPC_depend && - Kind != OMPC_doacross && Kind != OMPC_map) || + Kind != OMPC_doacross && Kind != OMPC_map && Kind != OMPC_adjust_args) || (Kind == OMPC_reduction && !InvalidReductionId) || (Kind == OMPC_map && Data.ExtraModifier != OMPC_MAP_unknown) || (Kind == OMPC_depend && Data.ExtraModifier != OMPC_DEPEND_unknown) || |