diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -853,14 +853,14 @@ } } // namespace -void Parser::parseOMPTraitPropertyKind( - OMPTraitProperty &TIProperty, llvm::omp::TraitSet Set, - llvm::omp::TraitSelector Selector, llvm::StringMap &Seen) { +void Parser::parseOMPTraitPropertyKind(OMPTraitProperty &TIProperty, + llvm::omp::TraitSet Set, + llvm::omp::TraitSelector Selector, + llvm::StringMap &Seen) { TIProperty.Kind = TraitProperty::invalid; SourceLocation NameLoc = Tok.getLocation(); - StringRef Name = - getNameFromIdOrString(*this, Tok, CONTEXT_TRAIT_LVL); + StringRef Name = getNameFromIdOrString(*this, Tok, CONTEXT_TRAIT_LVL); if (Name.empty()) { Diag(Tok.getLocation(), diag::note_omp_declare_variant_ctx_options) << CONTEXT_TRAIT_LVL << listOpenMPContextTraitProperties(Set, Selector); @@ -1017,14 +1017,13 @@ << CONTEXT_TRAIT_LVL; } -void Parser::parseOMPTraitSelectorKind( - OMPTraitSelector &TISelector, llvm::omp::TraitSet Set, - llvm::StringMap &Seen) { +void Parser::parseOMPTraitSelectorKind(OMPTraitSelector &TISelector, + llvm::omp::TraitSet Set, + llvm::StringMap &Seen) { TISelector.Kind = TraitSelector::invalid; SourceLocation NameLoc = Tok.getLocation(); - StringRef Name = getNameFromIdOrString(*this, Tok, CONTEXT_SELECTOR_LVL - ); + StringRef Name = getNameFromIdOrString(*this, Tok, CONTEXT_SELECTOR_LVL); if (Name.empty()) { Diag(Tok.getLocation(), diag::note_omp_declare_variant_ctx_options) << CONTEXT_SELECTOR_LVL << listOpenMPContextTraitSelectors(Set); @@ -1210,8 +1209,7 @@ TISet.Kind = TraitSet::invalid; SourceLocation NameLoc = Tok.getLocation(); - StringRef Name = getNameFromIdOrString(*this, Tok, CONTEXT_SELECTOR_SET_LVL - ); + StringRef Name = getNameFromIdOrString(*this, Tok, CONTEXT_SELECTOR_SET_LVL); if (Name.empty()) { Diag(Tok.getLocation(), diag::note_omp_declare_variant_ctx_options) << CONTEXT_SELECTOR_SET_LVL << listOpenMPContextTraitSets(); @@ -1269,8 +1267,7 @@ /// /// '=' '{' [, ]* '}' void Parser::parseOMPContextSelectorSet( - OMPTraitSet &TISet, - llvm::StringMap &SeenSets) { + OMPTraitSet &TISet, llvm::StringMap &SeenSets) { auto OuterBC = BraceCount; // If anything went wrong we issue an error or warning and then skip the rest @@ -1346,7 +1343,7 @@ /// Parse OpenMP context selectors: /// /// [, ]* -bool Parser::parseOMPContextSelectors(SourceLocation Loc, OMPTraitInfo& TI) { +bool Parser::parseOMPContextSelectors(SourceLocation Loc, OMPTraitInfo &TI) { llvm::StringMap SeenSets; do { OMPTraitSet TISet; @@ -1523,16 +1520,16 @@ /// device_type-clause: /// 'device_type' '(' 'host' | 'nohost' | 'any' )' namespace { - struct SimpleClauseData { - unsigned Type; - SourceLocation Loc; - SourceLocation LOpen; - SourceLocation TypeLoc; - SourceLocation RLoc; - SimpleClauseData(unsigned Type, SourceLocation Loc, SourceLocation LOpen, - SourceLocation TypeLoc, SourceLocation RLoc) - : Type(Type), Loc(Loc), LOpen(LOpen), TypeLoc(TypeLoc), RLoc(RLoc) {} - }; +struct SimpleClauseData { + unsigned Type; + SourceLocation Loc; + SourceLocation LOpen; + SourceLocation TypeLoc; + SourceLocation RLoc; + SimpleClauseData(unsigned Type, SourceLocation Loc, SourceLocation LOpen, + SourceLocation TypeLoc, SourceLocation RLoc) + : Type(Type), Loc(Loc), LOpen(LOpen), TypeLoc(TypeLoc), RLoc(RLoc) {} +}; } // anonymous namespace static Optional @@ -1596,7 +1593,7 @@ Diag(DevTypeData.getValue().Loc, diag::warn_omp_more_one_device_type_clause); } - switch(static_cast(DevTypeData.getValue().Type)) { + switch (static_cast(DevTypeData.getValue().Type)) { case OMPC_DEVICE_TYPE_any: DT = OMPDeclareTargetDeclAttr::DT_Any; break; @@ -1949,7 +1946,7 @@ CachedTokens Toks; Toks.push_back(Tok); ConsumeToken(); - while(Tok.isNot(tok::annot_pragma_openmp_end)) { + while (Tok.isNot(tok::annot_pragma_openmp_end)) { Toks.push_back(Tok); ConsumeAnyToken(); } @@ -1997,7 +1994,7 @@ return DeclGroupPtrTy(); ParsingOpenMPDirectiveRAII NormalScope(*this, /*Value=*/false); - llvm::SmallVector Decls; + llvm::SmallVector Decls; DKind = parseOpenMPDirectiveKind(*this); while (DKind != OMPD_end_declare_target && Tok.isNot(tok::eof) && Tok.isNot(tok::r_brace)) { @@ -2457,8 +2454,8 @@ // bool Parser::ParseOpenMPSimpleVarList( OpenMPDirectiveKind Kind, - const llvm::function_ref & - Callback, + const llvm::function_ref + &Callback, bool AllowScopeSpecifier) { // Parse '('. BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end); @@ -2588,8 +2585,8 @@ // Check if clause is allowed for the given directive. if (CKind != OMPC_unknown && !isAllowedClauseForDirective(DKind, CKind, getLangOpts().OpenMP)) { - Diag(Tok, diag::err_omp_unexpected_clause) << getOpenMPClauseName(CKind) - << getOpenMPDirectiveName(DKind); + Diag(Tok, diag::err_omp_unexpected_clause) + << getOpenMPClauseName(CKind) << getOpenMPDirectiveName(DKind); ErrorFound = true; WrongDirective = true; } @@ -2785,8 +2782,8 @@ return ExprError(); SourceLocation ELoc = Tok.getLocation(); - ExprResult LHS(ParseCastExpression(AnyCastExpr, IsAddressOfOperand, - NotTypeCast)); + ExprResult LHS( + ParseCastExpression(AnyCastExpr, IsAddressOfOperand, NotTypeCast)); ExprResult Val(ParseRHSOfBinaryExpression(LHS, prec::Conditional)); Val = Actions.ActOnFinishFullExpr(Val.get(), ELoc, /*DiscardedValue*/ false); @@ -3384,7 +3381,7 @@ bool HasIterator = false; bool NeedRParenForLinear = false; BalancedDelimiterTracker LinearT(*this, tok::l_paren, - tok::annot_pragma_openmp_end); + tok::annot_pragma_openmp_end); // Handle reduction-identifier for reduction clause. if (Kind == OMPC_reduction || Kind == OMPC_task_reduction || Kind == OMPC_in_reduction) { @@ -3500,7 +3497,7 @@ TentativeParsingAction TPA(*this); bool ColonPresent = false; if (SkipUntil(tok::colon, tok::r_paren, tok::annot_pragma_openmp_end, - StopBeforeMatch)) { + StopBeforeMatch)) { if (Tok.is(tok::colon)) ColonPresent = true; } @@ -3737,4 +3734,3 @@ Data.IsMapTypeImplicit, Data.ExtraModifierLoc, Data.MotionModifiers, Data.MotionModifiersLoc); } -