Skip to content

Commit d7aa585

Browse files
author
Shashwathi N
committed
Formatting
1 parent 7bec4d1 commit d7aa585

File tree

5 files changed

+42
-43
lines changed

5 files changed

+42
-43
lines changed

clang/include/clang/AST/OpenMPClause.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7476,7 +7476,8 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
74767476

74777477
/// Motion-modifiers for the 'to' clause.
74787478
OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7479-
OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown};
7479+
OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7480+
OMPC_MOTION_MODIFIER_unknown};
74807481

74817482
/// Location of motion-modifiers for the 'to' clause.
74827483
SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];
@@ -7585,15 +7586,14 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
75857586
/// \param UDMQualifierLoc C++ nested name specifier for the associated
75867587
/// user-defined mapper.
75877588
/// \param MapperId The identifier of associated user-defined mapper.
7588-
static OMPToClause *Create(const ASTContext &C, const OMPVarListLocTy &Locs,
7589-
ArrayRef<Expr *> Vars,
7590-
ArrayRef<ValueDecl *> Declarations,
7591-
MappableExprComponentListsRef ComponentLists,
7592-
ArrayRef<Expr *> UDMapperRefs,Expr *IteratorModifier,
7593-
ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7594-
ArrayRef<SourceLocation> MotionModifiersLoc,
7595-
NestedNameSpecifierLoc UDMQualifierLoc,
7596-
DeclarationNameInfo MapperId);
7589+
static OMPToClause *
7590+
Create(const ASTContext &C, const OMPVarListLocTy &Locs,
7591+
ArrayRef<Expr *> Vars, ArrayRef<ValueDecl *> Declarations,
7592+
MappableExprComponentListsRef ComponentLists,
7593+
ArrayRef<Expr *> UDMapperRefs, Expr *IteratorModifier,
7594+
ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
7595+
ArrayRef<SourceLocation> MotionModifiersLoc,
7596+
NestedNameSpecifierLoc UDMQualifierLoc, DeclarationNameInfo MapperId);
75977597

75987598
/// Creates an empty clause with the place for \a NumVars variables.
75997599
///
@@ -7682,7 +7682,8 @@ class OMPFromClause final
76827682

76837683
/// Motion-modifiers for the 'from' clause.
76847684
OpenMPMotionModifierKind MotionModifiers[NumberOfOMPMotionModifiers] = {
7685-
OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown};
7685+
OMPC_MOTION_MODIFIER_unknown, OMPC_MOTION_MODIFIER_unknown,
7686+
OMPC_MOTION_MODIFIER_unknown};
76867687

76877688
/// Location of motion-modifiers for the 'from' clause.
76887689
SourceLocation MotionModifiersLoc[NumberOfOMPMotionModifiers];

clang/lib/AST/OpenMPClause.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,12 +2573,12 @@ template <typename T> void OMPClausePrinter::VisitOMPMotionClause(T *Node) {
25732573
if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_iterator)
25742574
PrintIterator(OS, Node, Policy);
25752575
else {
2576-
OS << getOpenMPSimpleClauseTypeName(Node->getClauseKind(),
2577-
Node->getMotionModifier(I));
2578-
if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
2579-
PrintMapper(OS, Node, Policy);
2580-
if (I < ModifierCount - 1)
2581-
OS << ", ";
2576+
OS << getOpenMPSimpleClauseTypeName(Node->getClauseKind(),
2577+
Node->getMotionModifier(I));
2578+
if (Node->getMotionModifier(I) == OMPC_MOTION_MODIFIER_mapper)
2579+
PrintMapper(OS, Node, Policy);
2580+
if (I < ModifierCount - 1)
2581+
OS << ", ";
25822582
}
25832583
}
25842584
}

clang/lib/Parse/ParseOpenMP.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4712,19 +4712,19 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind,
47124712
Data.IteratorExpr = Tail.get();
47134713
}
47144714
} else {
4715-
ConsumeToken();
4716-
if (Modifier == OMPC_MOTION_MODIFIER_mapper) {
4717-
IsInvalidMapperModifier = parseMapperModifier(Data);
4718-
if (IsInvalidMapperModifier)
4719-
break;
4720-
}
4721-
// OpenMP < 5.1 doesn't permit a ',' or additional modifiers.
4722-
if (getLangOpts().OpenMP < 51)
4723-
break;
4724-
// OpenMP 5.1 accepts an optional ',' even if the next character is ':'.
4725-
// TODO: Is that intentional?
4726-
if (Tok.is(tok::comma))
47274715
ConsumeToken();
4716+
if (Modifier == OMPC_MOTION_MODIFIER_mapper) {
4717+
IsInvalidMapperModifier = parseMapperModifier(Data);
4718+
if (IsInvalidMapperModifier)
4719+
break;
4720+
}
4721+
// OpenMP < 5.1 doesn't permit a ',' or additional modifiers.
4722+
if (getLangOpts().OpenMP < 51)
4723+
break;
4724+
// OpenMP 5.1 accepts an optional ',' even if the next character is ':'.
4725+
// TODO: Is that intentional?
4726+
if (Tok.is(tok::comma))
4727+
ConsumeToken();
47284728
}
47294729
}
47304730
if (!Data.MotionModifiers.empty() && Tok.isNot(tok::colon)) {

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23464,8 +23464,7 @@ void SemaOpenMP::ActOnOpenMPDeclareTargetInitializer(Decl *TargetDecl) {
2346423464

2346523465
OMPClause *SemaOpenMP::ActOnOpenMPToClause(
2346623466
ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
23467-
ArrayRef<SourceLocation> MotionModifiersLoc,
23468-
Expr *IteratorExpr,
23467+
ArrayRef<SourceLocation> MotionModifiersLoc, Expr *IteratorExpr,
2346923468
CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo &MapperId,
2347023469
SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
2347123470
const OMPVarListLocTy &Locs, ArrayRef<Expr *> UnresolvedMappers) {
@@ -23494,14 +23493,15 @@ OMPClause *SemaOpenMP::ActOnOpenMPToClause(
2349423493
MapperIdScopeSpec, MapperId, UnresolvedMappers);
2349523494
if (MVLI.ProcessedVarList.empty())
2349623495
return nullptr;
23497-
if(IteratorExpr)
23498-
if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
23499-
if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
23496+
if (IteratorExpr)
23497+
if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
23498+
if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
2350023499
DSAStack->addIteratorVarDecl(VD);
2350123500
return OMPToClause::Create(
2350223501
getASTContext(), Locs, MVLI.ProcessedVarList, MVLI.VarBaseDeclarations,
23503-
MVLI.VarComponents, MVLI.UDMapperList,IteratorExpr, Modifiers, ModifiersLoc,
23504-
MapperIdScopeSpec.getWithLocInContext(getASTContext()), MapperId);
23502+
MVLI.VarComponents, MVLI.UDMapperList, IteratorExpr, Modifiers,
23503+
ModifiersLoc, MapperIdScopeSpec.getWithLocInContext(getASTContext()),
23504+
MapperId);
2350523505
}
2350623506

2350723507
OMPClause *SemaOpenMP::ActOnOpenMPFromClause(
@@ -23536,8 +23536,8 @@ OMPClause *SemaOpenMP::ActOnOpenMPFromClause(
2353623536
if (MVLI.ProcessedVarList.empty())
2353723537
return nullptr;
2353823538
if (IteratorExpr)
23539-
if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
23540-
if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
23539+
if (auto *DRE = dyn_cast<DeclRefExpr>(IteratorExpr))
23540+
if (auto *VD = dyn_cast<VarDecl>(DRE->getDecl()))
2354123541
DSAStack->addIteratorVarDecl(VD);
2354223542
return OMPFromClause::Create(
2354323543
getASTContext(), Locs, MVLI.ProcessedVarList, MVLI.VarBaseDeclarations,

clang/lib/Sema/TreeTransform.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,8 +2196,7 @@ class TreeTransform {
21962196
OMPClause *
21972197
RebuildOMPToClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
21982198
ArrayRef<SourceLocation> MotionModifiersLoc,
2199-
Expr *IteratorModifier,
2200-
CXXScopeSpec &MapperIdScopeSpec,
2199+
Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
22012200
DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
22022201
ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
22032202
ArrayRef<Expr *> UnresolvedMappers) {
@@ -2214,8 +2213,7 @@ class TreeTransform {
22142213
OMPClause *
22152214
RebuildOMPFromClause(ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
22162215
ArrayRef<SourceLocation> MotionModifiersLoc,
2217-
Expr *IteratorModifier,
2218-
CXXScopeSpec &MapperIdScopeSpec,
2216+
Expr *IteratorModifier, CXXScopeSpec &MapperIdScopeSpec,
22192217
DeclarationNameInfo &MapperId, SourceLocation ColonLoc,
22202218
ArrayRef<Expr *> VarList, const OMPVarListLocTy &Locs,
22212219
ArrayRef<Expr *> UnresolvedMappers) {
@@ -11438,7 +11436,7 @@ template <typename Derived>
1143811436
OMPClause *TreeTransform<Derived>::TransformOMPFromClause(OMPFromClause *C) {
1143911437
OMPVarListLocTy Locs(C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
1144011438
llvm::SmallVector<Expr *, 16> Vars;
11441-
Expr *IteratorModifier = C->getIteratorModifier();
11439+
Expr *IteratorModifier = C->getIteratorModifier();
1144211440
if (IteratorModifier) {
1144311441
ExprResult MapModRes = getDerived().TransformExpr(IteratorModifier);
1144411442
if (MapModRes.isInvalid())

0 commit comments

Comments
 (0)