[clang] [OpenACC] Implement beginning parts of the 'parallel' Sema impl (PR #81659)

via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 16 06:39:16 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff db4ea21dfde307f4fc873a6fe56791cd7ae3f0a1 cf3ac4cd3bff222ff8a78368b91675b547d86833 -- clang/test/SemaOpenACC/compute-construct-ast.cpp clang/test/SemaOpenACC/parallel-assoc-stmt-inst.cpp clang/test/SemaOpenACC/parallel-loc-and-stmt.c clang/test/SemaOpenACC/parallel-loc-and-stmt.cpp clang/test/SemaOpenACC/unimplemented-construct.c clang/include/clang/AST/StmtOpenACC.h clang/include/clang/Sema/Sema.h clang/lib/AST/ASTContext.cpp clang/lib/AST/StmtOpenACC.cpp clang/lib/Parse/ParseOpenACC.cpp clang/lib/Sema/SemaOpenACC.cpp clang/lib/Sema/TreeTransform.h clang/test/ParserOpenACC/parse-clauses.c clang/test/ParserOpenACC/parse-clauses.cpp clang/test/ParserOpenACC/parse-constructs.c clang/test/ParserOpenACC/parse-wait-clause.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/SemaOpenACC.cpp b/clang/lib/Sema/SemaOpenACC.cpp
index de6f1bac21..d365a5151a 100644
--- a/clang/lib/Sema/SemaOpenACC.cpp
+++ b/clang/lib/Sema/SemaOpenACC.cpp
@@ -74,14 +74,14 @@ StmtResult Sema::ActOnEndOpenACCStmtDirective(OpenACCDirectiveKind K,
                                               SourceLocation EndLoc,
                                               StmtResult AssocStmt) {
   switch (K) {
-    default:
-      return StmtEmpty();
-    case OpenACCDirectiveKind::Invalid:
-      return StmtError();
-    case OpenACCDirectiveKind::Parallel:
-      return OpenACCComputeConstruct::Create(
-          getASTContext(), K, StartLoc, EndLoc,
-          AssocStmt.isUsable() ? AssocStmt.get() : nullptr);
+  default:
+    return StmtEmpty();
+  case OpenACCDirectiveKind::Invalid:
+    return StmtError();
+  case OpenACCDirectiveKind::Parallel:
+    return OpenACCComputeConstruct::Create(
+        getASTContext(), K, StartLoc, EndLoc,
+        AssocStmt.isUsable() ? AssocStmt.get() : nullptr);
   }
   llvm_unreachable("Unhandled case in directive handling?");
 }
@@ -90,7 +90,7 @@ StmtResult Sema::ActOnOpenACCAssociatedStmt(OpenACCDirectiveKind K,
                                             StmtResult AssocStmt) {
   switch (K) {
   default:
-  llvm_unreachable("Unimplemented associated statement application");
+    llvm_unreachable("Unimplemented associated statement application");
   case OpenACCDirectiveKind::Parallel:
     // There really isn't any checking here that could happen. As long as we
     // have a statement to associate, this should be fine.

``````````

</details>


https://github.com/llvm/llvm-project/pull/81659


More information about the cfe-commits mailing list