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 origin/main HEAD --extensions h,cpp --
clang/test/OpenMP/target_update_iterator_ast_print.cpp
clang/include/clang/AST/OpenMPClause.h clang/include/clang/Sema/SemaOpenMP.h
clang/lib/AST/OpenMPClause.cpp clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaOpenMP.cpp clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReader.cpp clang/lib/Serialization/ASTWriter.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/AST/OpenMPClause.h
b/clang/include/clang/AST/OpenMPClause.h
index 4e5a86482..9681e3507 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -7476,7 +7476,8 @@ class OMPToClause final : public
OMPMappableExprListClause<OMPToClause>,
/// Motion-modifiers for the 'to' clause.
OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
- OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
OMPC_MOTION_MODIFIER_unknown};
+ OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
+ OMPC_MOTION_MODIFIER_unknown};
/// Location of motion-modifiers for the 'to' clause.
SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
@@ -7585,15 +7586,14 @@ public:
/// \param UDMQualifierLoc C++ nested name specifier for the associated
/// user-defined mapper.
/// \param MapperId The identifier of associated user-defined mapper.
- static OMPToClause *Create(const ASTContext &C, const OMPVarListLocTy &Locs,
- ArrayRef<Expr *> Vars,
- ArrayRef<ValueDecl *> Declarations,
- MappableExprComponentListsRef ComponentLists,
- ArrayRef<Expr *> UDMapperRefs,Expr
*IteratorModifier,
- ArrayRef<OpenMPMotionModifierKind>
MotionModifiers,
- ArrayRef<SourceLocation> MotionModifiersLoc,
- NestedNameSpecifierLoc UDMQualifierLoc,
- DeclarationNameInfo MapperId);
+ static OMPToClause *
+ Create(const ASTContext &C, const OMPVarListLocTy &Locs,
+ ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
+ MappableExprComponentListsRef ComponentLists,
+ ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
+ ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
+ ArrayRef<SourceLocation> MotionModifiersLoc,
+ NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
/// Creates an empty clause with the place for \a NumVars variables.
///
@@ -7682,7 +7682,8 @@ class OMPFromClause final
/// Motion-modifiers for the 'from' clause.
OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
- OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
OMPC_MOTION_MODIFIER_unknown};
+ OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
+ OMPC_MOTION_MODIFIER_unknown};
/// Location of motion-modifiers for the 'from' clause.
SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index de352df0f..8146c1fa4 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -2573,12 +2573,12 @@ template <typename T> void
OMPClausePrinter::VisitOMPMotionClause(T *Node) {
if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_iterator)
PrintIterator(OS, Node, Policy);
else {
- OS << getOpenMPSimpleClauseTypeName(Node->getClauseKind(),
- Node->getMotionModifier(I));
- if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
- PrintMapper(OS, Node, Policy);
- if (I < ModifierCount - 1)
- OS << ", ";
+ OS << getOpenMPSimpleClauseTypeName(Node->getClauseKind(),
+ Node->getMotionModifier(I));
+ if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
+ PrintMapper(OS, Node, Policy);
+ if (I < ModifierCount - 1)
+ OS << ", ";
}
}
}
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 75fd5a12f..48296c50d 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4712,19 +4712,19 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind
DKind,
Data.IteratorExpr = Tail.get();
}
} else {
- ConsumeToken();
- if (Modifier == OMPC_MOTION_MODIFIER_mapper) {
- IsInvalidMapperModifier = parseMapperModifier(Data);
- if (IsInvalidMapperModifier)
- break;
- }
- // OpenMP < 5.1 doesn't permit a ',' or additional modifiers.
- if (getLangOpts().OpenMP < 51)
- break;
- // OpenMP 5.1 accepts an optional ',' even if the next character is ':'.
- // TODO: Is that intentional?
- if (Tok.is(tok::comma))
ConsumeToken();
+ if (Modifier == OMPC_MOTION_MODIFIER_mapper) {
+ IsInvalidMapperModifier = parseMapperModifier(Data);
+ if (IsInvalidMapperModifier)
+ break;
+ }
+ // OpenMP < 5.1 doesn't permit a ',' or additional modifiers.
+ if (getLangOpts().OpenMP < 51)
+ break;
+ // OpenMP 5.1 accepts an optional ',' even if the next character is
':'.
+ // TODO: Is that intentional?
+ if (Tok.is(tok::comma))
+ ConsumeToken();
}
}
if (!Data.MotionModifiers.empty() && Tok.isNot(tok::colon)) {
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index b31a43354..e92ac3f80 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -23471,8 +23471,7 @@ void
SemaOpenMP::ActOnOpenMPDeclareTargetInitializer(Decl *TargetDecl) {
OMPClause *SemaOpenMP::ActOnOpenMPToClause(
ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
- ArrayRef<SourceLocation> MotionModifiersLoc,
- Expr *IteratorExpr,
+ ArrayRef<SourceLocation> MotionModifiersLoc, Expr *IteratorExpr,
CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
const OMPVarListLocTy &Locs, ArrayRef<Expr *> UnresolvedMappers) {
@@ -23501,14 +23500,15 @@ OMPClause *SemaOpenMP::ActOnOpenMPToClause(
MapperIdScopeSpec, MapperId, UnresolvedMappers);
if (MVLI.ProcessedVarList.empty())
return nullptr;
- if(IteratorExpr)
- if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
- if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
+ if (IteratorExpr)
+ if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
+ if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
DSAStack->addIteratorVarDecl(VD);
return OMPToClause::Create(
getASTContext(), Locs, MVLI.ProcessedVarList, MVLI.VarBaseDeclarations,
- MVLI.VarComponents, MVLI.UDMapperList,IteratorExpr, Modifiers,
ModifiersLoc,
- MapperIdScopeSpec.getWithLocInContext(getASTContext()), MapperId);
+ MVLI.VarComponents, MVLI.UDMapperList, IteratorExpr, Modifiers,
+ ModifiersLoc, MapperIdScopeSpec.getWithLocInContext(getASTContext()),
+ MapperId);
}
OMPClause *SemaOpenMP::ActOnOpenMPFromClause(
@@ -23543,8 +23543,8 @@ OMPClause *SemaOpenMP::ActOnOpenMPFromClause(
if (MVLI.ProcessedVarList.empty())
return nullptr;
if (IteratorExpr)
- if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
- if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
+ if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
+ if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
DSAStack->addIteratorVarDecl(VD);
return OMPFromClause::Create(
getASTContext(), Locs, MVLI.ProcessedVarList, MVLI.VarBaseDeclarations,
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 636f54c21..63da489a5 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -2196,8 +2196,7 @@ public:
OMPClause *
RebuildOMPToClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
ArrayRef<SourceLocation> MotionModifiersLoc,
- Expr *IteratorModifier,
- CXXScopeSpec &MapperIdScopeSpec,
+ Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
ArrayRef<Expr *> UnresolvedMappers) {
@@ -2214,8 +2213,7 @@ public:
OMPClause *
RebuildOMPFromClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
ArrayRef<SourceLocation> MotionModifiersLoc,
- Expr *IteratorModifier,
- CXXScopeSpec &MapperIdScopeSpec,
+ Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
ArrayRef<Expr *> UnresolvedMappers) {
@@ -11438,7 +11436,7 @@ template <typename Derived>
OMPClause *TreeTransform<Derived>::TransformOMPFromClause(OMPFromClause *C) {
OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
llvm::SmallVector<Expr *, 16> Vars;
- Expr *IteratorModifier = C->getIteratorModifier();
+ Expr *IteratorModifier = C->getIteratorModifier();
if (IteratorModifier) {
ExprResult MapModRes = getDerived().TransformExpr(IteratorModifier);
if (MapModRes.isInvalid())
``````````
</details>
https://github.com/llvm/llvm-project/pull/159112
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits