From 54acf9a3a31ef1a18b7b9b10143296e7c3c077fd Mon Sep 17 00:00:00 2001 From: Kiran Chandramohan Date: Mon, 27 Feb 2023 16:31:16 +0000 Subject: [PATCH] [Flang][OpenMP] NFC: Change a few message/comments to fit 80chars Changes are all in the OpenMP semantic checks file. Reviewed By: SBallantyne Differential Revision: https://reviews.llvm.org/D144874 --- flang/lib/Semantics/check-omp-structure.cpp | 46 ++++++++++++++++++----------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp index c29e9a9..b30ea41 100644 --- a/flang/lib/Semantics/check-omp-structure.cpp +++ b/flang/lib/Semantics/check-omp-structure.cpp @@ -111,7 +111,8 @@ public: } if (cycleLevel_ > 0 || err) { context_.Say(*cycleSource_, - "CYCLE statement to non-innermost associated loop of an OpenMP DO construct"_err_en_US); + "CYCLE statement to non-innermost associated loop of an OpenMP DO " + "construct"_err_en_US); } return true; } @@ -245,7 +246,8 @@ void OmpStructureChecker::HasInvalidDistributeNesting( } if (violation) { context_.Say(beginDir.source, - "`DISTRIBUTE` region has to be strictly nested inside `TEAMS` region."_err_en_US); + "`DISTRIBUTE` region has to be strictly nested inside `TEAMS` " + "region."_err_en_US); } } @@ -270,7 +272,8 @@ void OmpStructureChecker::HasInvalidTeamsNesting( if (!allowedSet.test(dir)) { context_.Say(source, - "Only `DISTRIBUTE` or `PARALLEL` regions are allowed to be strictly nested inside `TEAMS` region."_err_en_US); + "Only `DISTRIBUTE` or `PARALLEL` regions are allowed to be strictly " + "nested inside `TEAMS` region."_err_en_US); } } @@ -335,8 +338,10 @@ void OmpStructureChecker::CheckHintClause( std::get_if(&ompClause->u)}) { std::optional hintValue = GetIntValue(hintClause->v); if (hintValue && *hintValue >= 0) { - if((*hintValue & 0xC) == 0xC /*`omp_sync_hint_nonspeculative` and `omp_lock_hint_speculative`*/ - || (*hintValue & 0x3) == 0x3 /*`omp_sync_hint_uncontended` and omp_sync_hint_contended*/ ) + /*`omp_sync_hint_nonspeculative` and `omp_lock_hint_speculative`*/ + if ((*hintValue & 0xC) == 0xC + /*`omp_sync_hint_uncontended` and omp_sync_hint_contended*/ + || (*hintValue & 0x3) == 0x3) context_.Say(clause.source, "Hint clause value " "is not a valid OpenMP synchronization value"_err_en_US); @@ -550,9 +555,9 @@ void OmpStructureChecker::CheckSIMDNest(const parser::OpenMPConstruct &c) { if (!eligibleSIMD) { context_.Say(parser::FindSourceLocation(c), "The only OpenMP constructs that can be encountered during execution " - "of a 'SIMD'" - " region are the `ATOMIC` construct, the `LOOP` construct, the `SIMD`" - " construct and the `ORDERED` construct with the `SIMD` clause."_err_en_US); + "of a 'SIMD' region are the `ATOMIC` construct, the `LOOP` construct, " + "the `SIMD` construct and the `ORDERED` construct with the `SIMD` " + "clause."_err_en_US); } } @@ -707,7 +712,9 @@ void OmpStructureChecker::CheckDistLinear( for (auto var : indexVars) { const Symbol &root{GetAssociationRoot(var)}; context_.Say(parser::FindSourceLocation(x), - "Variable '%s' not allowed in `LINEAR` clause, only loop iterator can be specified in `LINEAR` clause of a construct combined with `DISTRIBUTE`"_err_en_US, + "Variable '%s' not allowed in `LINEAR` clause, only loop iterator " + "can be specified in `LINEAR` clause of a construct combined with " + "`DISTRIBUTE`"_err_en_US, root.name()); } } @@ -1025,7 +1032,8 @@ void OmpStructureChecker::CheckThreadprivateOrDeclareTargetVar( context_.Say(name->source, "A variable that appears in a %s directive must be " "declared in the scope of a module or have the SAVE " - "attribute, either explicitly or implicitly"_err_en_US, + "attribute, either explicitly or " + "implicitly"_err_en_US, ContextDirectiveAsFortran()); } else if (useScope != declScope) { context_.Say(name->source, @@ -1334,7 +1342,8 @@ void OmpStructureChecker::Enter(const parser::OpenMPCriticalConstruct &x) { ompClause.source.NULTerminatedToString() != "hint(omp_sync_hint_none)") { context_.Say(dir.source, parser::MessageFormattedText{ - "Hint clause other than omp_sync_hint_none cannot be specified for an unnamed CRITICAL directive"_err_en_US}); + "Hint clause other than omp_sync_hint_none cannot be specified for " + "an unnamed CRITICAL directive"_err_en_US}); } CheckHintClause(&ompClause, nullptr); } @@ -1593,7 +1602,8 @@ void OmpStructureChecker::CheckAtomicUpdateAssignmentStmt( [&](const auto &x) { if (!IsOperatorValid(x, var)) { context_.Say(expr.source, - "Invalid operator in OpenMP ATOMIC (UPDATE) statement"_err_en_US); + "Invalid operator in OpenMP ATOMIC (UPDATE) " + "statement"_err_en_US); } }, }, @@ -1929,7 +1939,8 @@ bool OmpStructureChecker::CheckReductionOperators( ok = true; } else { context_.Say(GetContext().clauseSource, - "Invalid reduction identifier in REDUCTION clause."_err_en_US, + "Invalid reduction identifier in REDUCTION " + "clause."_err_en_US, ContextDirectiveAsFortran()); } } @@ -1952,7 +1963,8 @@ bool OmpStructureChecker::CheckIntrinsicOperator( return true; case parser::DefinedOperator::IntrinsicOperator::Subtract: context_.Say(GetContext().clauseSource, - "The minus reduction operator is deprecated since OpenMP 5.2 and is not supported in the REDUCTION clause."_err_en_US, + "The minus reduction operator is deprecated since OpenMP 5.2 and is " + "not supported in the REDUCTION clause."_err_en_US, ContextDirectiveAsFortran()); break; default: @@ -2037,8 +2049,7 @@ void OmpStructureChecker::CheckMultipleAppearanceAcrossContext( "%s variable '%s' is %s in outer context must" " be shared in the parallel regions to which any" " of the worksharing regions arising from the " - "worksharing" - " construct bind."_err_en_US, + "worksharing construct bind."_err_en_US, parser::ToUpperCaseLetters( getClauseName(llvm::omp::Clause::OMPC_reduction) .str()), @@ -2540,7 +2551,8 @@ void OmpStructureChecker::CheckArraySection( if ((stride && stride != 1)) { context_.Say(GetContext().clauseSource, "A list item that appears in a REDUCTION clause" - " should have a contiguous storage array section."_err_en_US, + " should have a contiguous storage array " + "section."_err_en_US, ContextDirectiveAsFortran()); break; } -- 2.7.4