[clang] [llvm] Draft/wip/preview of using leaf constructs in clang (PR #84817)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 11 12:52:21 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 2a38551457cb2b38dcca35e30e9f2d7fce9ae3e7 0f4bf060d080b156708ff6e9d3fa7987e7652b9c -- clang/include/clang/Sema/Sema.h clang/lib/Basic/OpenMPKinds.cpp clang/lib/Parse/ParseOpenMP.cpp clang/lib/Sema/SemaOpenMP.cpp 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/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index e5e62d5ea5..b50dc17153 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -13718,9 +13718,9 @@ public:
///
/// \returns Statement for finished OpenMP region.
StmtResult ActOnOpenMPRegionEnd(StmtResult S, ArrayRef<OMPClause *> Clauses);
- StmtResult ActOnOpenMPRegionEnd(
- StmtResult S, ArrayRef<OMPClause *> Clauses,
- std::function<StmtResult(StmtResult)> callback);
+ StmtResult
+ ActOnOpenMPRegionEnd(StmtResult S, ArrayRef<OMPClause *> Clauses,
+ std::function<StmtResult(StmtResult)> callback);
StmtResult ActOnOpenMPExecutableDirective(
OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp
index 289da88040..45ac517be6 100644
--- a/clang/lib/Basic/OpenMPKinds.cpp
+++ b/clang/lib/Basic/OpenMPKinds.cpp
@@ -723,7 +723,7 @@ void clang::getOpenMPCaptureRegions(
// case OMPD_parallel_sections:
case OMPD_distribute_parallel_for:
case OMPD_distribute_parallel_for_simd:
- // case OMPD_parallel_loop:
+ // case OMPD_parallel_loop:
CaptureRegions.push_back(OMPD_parallel);
break;
// case OMPD_target_teams:
@@ -734,8 +734,8 @@ void clang::getOpenMPCaptureRegions(
CaptureRegions.push_back(OMPD_teams);
break;
case OMPD_teams:
- // case OMPD_teams_distribute:
- // case OMPD_teams_distribute_simd:
+ // case OMPD_teams_distribute:
+ // case OMPD_teams_distribute_simd:
CaptureRegions.push_back(OMPD_teams);
break;
case OMPD_target:
@@ -752,7 +752,7 @@ void clang::getOpenMPCaptureRegions(
// case OMPD_target_parallel:
case OMPD_target_parallel_for:
case OMPD_target_parallel_for_simd:
- // case OMPD_target_parallel_loop:
+ // case OMPD_target_parallel_loop:
CaptureRegions.push_back(OMPD_task);
CaptureRegions.push_back(OMPD_target);
CaptureRegions.push_back(OMPD_parallel);
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 711c3fb2ba..7b162e4723 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -2977,8 +2977,8 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective(
AssociatedStmt = Actions.ActOnOpenMPRegionEnd(
AssociatedStmt, Clauses, [&](StmtResult S) {
return Actions.ActOnOpenMPExecutableDirective(
- Leaves[i--], DirName, CancelRegion, Clauses, S.get(),
- Loc, EndLoc);
+ Leaves[i--], DirName, CancelRegion, Clauses, S.get(), Loc,
+ EndLoc);
});
} else {
AssociatedStmt = Actions.ActOnOpenMPRegionEnd(AssociatedStmt, Clauses);
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index f9edacb7cc..e00d1ef1d2 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -4275,7 +4275,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
break;
}
case OMPD_target: {
- // case OMPD_target_simd: {
+ // case OMPD_target_simd: {
QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
QualType KmpInt32PtrTy =
@@ -4807,8 +4807,8 @@ static bool checkOrderedOrderSpecified(Sema &S,
return false;
}
-StmtResult
-Sema::ActOnOpenMPRegionEnd(StmtResult S, ArrayRef<OMPClause *> Clauses) {
+StmtResult Sema::ActOnOpenMPRegionEnd(StmtResult S,
+ ArrayRef<OMPClause *> Clauses) {
return ActOnOpenMPRegionEnd(S, Clauses, [](StmtResult S) { return S; });
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/84817
More information about the cfe-commits
mailing list