[PATCH] D99905: [OPENMP51]Initial parsing/sema for adjust_args clause for 'declare variant'

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 05:24:03 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:1447-1448
+    if (IsError) {
+      while (!SkipUntil(tok::annot_pragma_openmp_end, StopBeforeMatch))
+        ;
+      // Skip the last annot_pragma_openmp_end.
----------------
I know this is code that existed previously, but why the `while` loop? This strikes me as a potential infinite loop because `SkipUntil` returns `false` when the token is not found, so if the token is not found the first time, I'd be surprised if a second pass at it finds the token.


================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:2045
+    if (parseOMPDeclareVariantMatchClause(Loc, TI, ParentTI)) {
+      while (!SkipUntil(tok::annot_pragma_openmp_end, Parser::StopBeforeMatch))
+        ;
----------------
Same question here as above.


================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:3989-3992
+      if (Tok.is(tok::colon))
+        Data.ColonLoc = ConsumeToken();
+      else
+        Diag(Tok, diag::warn_pragma_expected_colon) << "adjust-op";
----------------
`ExpectAndConsume`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99905/new/

https://reviews.llvm.org/D99905



More information about the llvm-commits mailing list