[PATCH] D115573: [Clang][OpenMP] Return error ahead of time if there are multiple mutex clauses in atomic directive

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 10 20:06:22 PST 2021


tianshilei1992 created this revision.
tianshilei1992 added reviewers: jdoerfert, ABataev.
Herald added subscribers: guansong, yaxunl.
tianshilei1992 requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

Currently if there are multiple mutex clauses used in `atomic` directive,
it emits an error but proceeds execution. This patch simply makes it return ahead
of time.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115573

Files:
  clang/lib/Sema/SemaOpenMP.cpp


Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -10942,6 +10942,7 @@
             << SourceRange(C->getBeginLoc(), C->getEndLoc());
         Diag(AtomicKindLoc, diag::note_omp_previous_mem_order_clause)
             << getOpenMPClauseName(AtomicKind);
+        return StmtError();
       } else {
         AtomicKind = C->getClauseKind();
         AtomicKindLoc = C->getBeginLoc();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115573.393658.patch
Type: text/x-patch
Size: 510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211211/e0708661/attachment.bin>


More information about the cfe-commits mailing list