Skip to content

[clang][OpenMP] Prototype #2 of directive splitting #109288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: users/kparzysz/spr/p02-a01-clang-opaque-directive
Choose a base branch
from

Conversation

kparzysz
Copy link
Contributor

This is proto #1 minus the introduction of opaque AST nodes.

This isn't 100% finished, but it should be enough to illustrate the changes needed to implement the feature.

Proto #1: #108855

Copy link

github-actions bot commented Sep 19, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 0baefe179b9f2e295ef4bbd659ca98a31e1547d0 b17dc927ab1c2c84e8ac9174f212be538c67efc0 --extensions h,cpp -- clang/lib/Sema/SemaOpenMPExt.cpp clang/lib/Sema/SemaOpenMPExt.h clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/Stmt.h clang/include/clang/Basic/OpenMPKinds.h clang/include/clang/Sema/SemaOpenMP.h clang/lib/AST/Stmt.cpp clang/lib/Basic/OpenMPKinds.cpp clang/lib/CodeGen/CGStmtOpenMP.cpp clang/lib/Parse/ParseOpenMP.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaOpenMP.cpp clang/lib/Sema/TreeTransform.h llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h llvm/include/llvm/Frontend/OpenMP/OMP.h llvm/lib/Frontend/OpenMP/OMP.cpp
View the diff from clang-format here.
diff --git a/clang/include/clang/Sema/SemaOpenMP.h b/clang/include/clang/Sema/SemaOpenMP.h
index 62dc569fef..75bdc6e430 100644
--- a/clang/include/clang/Sema/SemaOpenMP.h
+++ b/clang/include/clang/Sema/SemaOpenMP.h
@@ -1433,9 +1433,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/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;

@kparzysz kparzysz force-pushed the users/kparzysz/spr/p02-a01-clang-opaque-directive branch from bba25fe to 0baefe1 Compare September 19, 2024 14:18
This is proto #1 minus the introduction of opaque AST nodes.

This isn't 100% finished, but it should be enough to illustrate
the changes needed to implement the feature.

Proto #1: #108855
@kparzysz kparzysz force-pushed the users/kparzysz/spr/p02-a02-proto branch from 915fe94 to b17dc92 Compare September 19, 2024 14:20
mako-tutor pushed a commit to mako-tutor/llvm that referenced this pull request Feb 23, 2025
This is proto #2 plus creating a root node for the broken-up directive
tree. The root node will hold the information needed to pretty-print the
original directive/clauses.

This isn't 100% finished, but it should be enough to illustrate
the changes needed to implement the feature.

Proto #2: llvm/llvm-project#109288
jollaitbot pushed a commit to sailfishos-mirror/llvm-project that referenced this pull request Mar 26, 2025
This is proto #2 plus creating a root node for the broken-up directive
tree. The root node will hold the information needed to pretty-print the
original directive/clauses.

This isn't 100% finished, but it should be enough to illustrate
the changes needed to implement the feature.

Proto #2: llvm/llvm-project#109288
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant