[clang] [llvm] [clang][OpenMP] Prototype #1 of directive splitting (PR #108855)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 16 09:53:49 PDT 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 bc54e5636f2080e6a35ec201d5963a2c455fe5f5 a50b7c891330ae16c7b9559f23afa6fcbfe7c391 --extensions h,cpp -- clang/lib/Sema/SemaOpenMPExt.cpp clang/lib/Sema/SemaOpenMPExt.h clang/include/clang-c/Index.h clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/RecursiveASTVisitor.h clang/include/clang/AST/Stmt.h clang/include/clang/AST/StmtOpenMP.h clang/include/clang/AST/TextNodeDumper.h clang/include/clang/Basic/OpenMPKinds.h clang/include/clang/Sema/SemaOpenMP.h clang/include/clang/Serialization/ASTBitCodes.h clang/lib/AST/Stmt.cpp clang/lib/AST/StmtOpenMP.cpp clang/lib/AST/StmtPrinter.cpp clang/lib/AST/StmtProfile.cpp clang/lib/AST/TextNodeDumper.cpp clang/lib/Basic/OpenMPKinds.cpp clang/lib/CodeGen/CGStmt.cpp clang/lib/CodeGen/CGStmtOpenMP.cpp clang/lib/Parse/ParseOpenMP.cpp clang/lib/Sema/SemaExceptionSpec.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaOpenMP.cpp clang/lib/Sema/TreeTransform.h clang/lib/Serialization/ASTReaderStmt.cpp clang/lib/Serialization/ASTWriterStmt.cpp clang/lib/StaticAnalyzer/Core/ExprEngine.cpp clang/test/OpenMP/default_firstprivate_ast_print.cpp clang/test/OpenMP/default_private_ast_print.cpp clang/test/OpenMP/generic_loop_ast_print.cpp clang/test/OpenMP/interop_ast_print.cpp clang/test/OpenMP/scope_ast_print.cpp clang/tools/libclang/CIndex.cpp clang/tools/libclang/CXCursor.cpp llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h llvm/include/llvm/Frontend/OpenMP/OMP.h llvm/lib/Frontend/OpenMP/OMP.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index ba4c14872d..ba9107bcc7 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -2159,11 +2159,11 @@ enum CXCursorKind {
CXCursor_OMPAssumeDirective = 309,
/** OpenMP compound block-associated directive.
- */
+ */
CXCursor_OMPCompoundBlockDirective = 310,
/** OpenMP compound loop-associated directive.
- */
+ */
CXCursor_OMPCompoundLoopDirective = 311,
/** OpenACC Compute Construct.
diff --git a/clang/include/clang/AST/StmtOpenMP.h b/clang/include/clang/AST/StmtOpenMP.h
index 919ebfe217..5c30eb3127 100644
--- a/clang/include/clang/AST/StmtOpenMP.h
+++ b/clang/include/clang/AST/StmtOpenMP.h
@@ -1643,11 +1643,9 @@ public:
/// \param Kind The OpenMP directive kind.
/// \param NumClauses Number of clauses.
///
- static OMPCompoundBlockDirective *CreateEmpty(const ASTContext &C,
- OpenMPDirectiveKind Kind,
- unsigned NumClauses,
- bool HasAssociatedStmt,
- EmptyShell);
+ static OMPCompoundBlockDirective *
+ CreateEmpty(const ASTContext &C, OpenMPDirectiveKind Kind,
+ unsigned NumClauses, bool HasAssociatedStmt, EmptyShell);
/// Returns special task reduction reference expression.
Expr *getTaskReductionRefExpr() const {
diff --git a/clang/include/clang/Sema/SemaOpenMP.h b/clang/include/clang/Sema/SemaOpenMP.h
index ded06306de..b5fac6727d 100644
--- a/clang/include/clang/Sema/SemaOpenMP.h
+++ b/clang/include/clang/Sema/SemaOpenMP.h
@@ -1432,9 +1432,9 @@ public:
VariableImplicitInfo &include(const VariableImplicitInfo &Other);
- #ifndef NDEBUG
+#ifndef NDEBUG
bool empty() const;
- #endif
+#endif
private:
std::pair<Stmt *, Decl *> getDecl(Expr *E);
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index d7ff8ac79a..6eef251e7f 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -9337,8 +9337,7 @@ StmtResult TreeTransform<Derived>::TransformOMPInformationalDirective(
}
template <typename Derived>
-StmtResult
-TreeTransform<Derived>::TransformOMPCompoundBlockDirective(
+StmtResult TreeTransform<Derived>::TransformOMPCompoundBlockDirective(
OMPCompoundBlockDirective *D) {
DeclarationNameInfo DirName;
getDerived().getSema().OpenMP().StartOpenMPDSABlock(
@@ -9349,8 +9348,7 @@ TreeTransform<Derived>::TransformOMPCompoundBlockDirective(
}
template <typename Derived>
-StmtResult
-TreeTransform<Derived>::TransformOMPCompoundLoopDirective(
+StmtResult TreeTransform<Derived>::TransformOMPCompoundLoopDirective(
OMPCompoundLoopDirective *D) {
DeclarationNameInfo DirName;
getDerived().getSema().OpenMP().StartOpenMPDSABlock(
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index 93272fcb14..c1b04fe42e 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -2412,8 +2412,7 @@ void ASTStmtWriter::VisitOMPCompoundBlockDirective(
Code = serialization::STMT_OMP_COMPOUND_BLOCK_DIRECTIVE;
}
-void ASTStmtWriter::VisitOMPCompoundLoopDirective(
- OMPCompoundLoopDirective *D) {
+void ASTStmtWriter::VisitOMPCompoundLoopDirective(OMPCompoundLoopDirective *D) {
VisitStmt(D);
Record.writeUInt32(static_cast<unsigned>(D->getDirectiveKind()));
VisitOMPLoopDirective(D);
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 1fae7fa549..4bf197f5cc 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3236,11 +3236,13 @@ void EnqueueVisitor::VisitOMPLoopDirective(const OMPLoopDirective *D) {
VisitOMPLoopBasedDirective(D);
}
-void EnqueueVisitor::VisitOMPCompoundBlockDirective(const OMPCompoundBlockDirective *D) {
+void EnqueueVisitor::VisitOMPCompoundBlockDirective(
+ const OMPCompoundBlockDirective *D) {
VisitOMPExecutableDirective(D);
}
-void EnqueueVisitor::VisitOMPCompoundLoopDirective(const OMPCompoundLoopDirective *D) {
+void EnqueueVisitor::VisitOMPCompoundLoopDirective(
+ const OMPCompoundLoopDirective *D) {
VisitOMPLoopDirective(D);
}
diff --git a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
index e15f78909d..5b5960da9d 100644
--- a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
+++ b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
@@ -96,7 +96,8 @@ struct ConstructDecompositionT {
llvm::omp::Directive dir,
llvm::ArrayRef<ClauseTy> clauses,
bool makeImplicit = true)
- : version(ver), construct(dir), makeImplicit(makeImplicit), helper(helper) {
+ : version(ver), construct(dir), makeImplicit(makeImplicit),
+ helper(helper) {
for (const ClauseTy &clause : clauses)
nodes.push_back(&clause);
@@ -253,7 +254,7 @@ private:
uint32_t version;
llvm::omp::Directive construct;
- bool makeImplicit; // Whether to create implicit clauses.
+ bool makeImplicit; // Whether to create implicit clauses.
HelperType &helper;
ListT<LeafReprInternal> leafs;
tomp::ListT<const ClauseTy *> nodes;
``````````
</details>
https://github.com/llvm/llvm-project/pull/108855
More information about the cfe-commits
mailing list