Skip to content

Commit d17a256

Browse files
committed
format
1 parent ba1324e commit d17a256

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

flang/lib/Semantics/canonicalize-omp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include "canonicalize-omp.h"
1010
#include "flang/Parser/parse-tree-visitor.h"
1111
#include "flang/Parser/parse-tree.h"
12-
#include "flang/Semantics/semantics.h"
1312
#include "flang/Semantics/openmp-directive-sets.h"
13+
#include "flang/Semantics/semantics.h"
1414

1515
// After Loop Canonicalization, rewrite OpenMP parse tree to make OpenMP
1616
// Constructs more structured which provide explicit scopes for later
@@ -139,7 +139,7 @@ class CanonicalizationOfOmp {
139139
parser::ToUpperCaseLetters(dirName.source.ToString()));
140140
};
141141
auto transformUnrollError = [](const parser::OmpDirectiveName &dirName,
142-
parser::Messages &messages) {
142+
parser::Messages &messages) {
143143
messages.Say(dirName.source,
144144
"If a loop construct has been fully unrolled, it cannot then be further transformed"_err_en_US,
145145
parser::ToUpperCaseLetters(dirName.source.ToString()));
@@ -196,7 +196,7 @@ class CanonicalizationOfOmp {
196196
// if a loop has been unrolled, the user can not then transform that
197197
// loop as it has been unrolled
198198
const parser::OmpClauseList &unrollClauseList{
199-
nestedBeginDirective.Clauses()};
199+
nestedBeginDirective.Clauses()};
200200
if (unrollClauseList.v.empty()) {
201201
// if the clause list is empty for an unroll construct, we assume
202202
// the loop is being fully unrolled

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,8 +2187,7 @@ void OmpAttributeVisitor::CollectNumAffectedLoopsFromInnerLoopContruct(
21872187
"Expected a DoConstruct or OpenMPLoopConstruct");
21882188
for (auto &nest : nestedList) {
21892189
const auto *innerConstruct =
2190-
std::get_if<common::Indirection<parser::OpenMPLoopConstruct>>(
2191-
&nest);
2190+
std::get_if<common::Indirection<parser::OpenMPLoopConstruct>>(&nest);
21922191

21932192
if (innerConstruct) {
21942193
CollectNumAffectedLoopsFromLoopConstruct(
@@ -2380,9 +2379,9 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
23802379
const parser::NestedConstruct *innerMostNest = nullptr;
23812380
if (const auto &innerloop{std::get_if<parser::DoConstruct>(&loopCons)}) {
23822381
innerMostNest = &loopCons;
2383-
} else if (const auto *innerLoop{
2384-
std::get_if<common::Indirection<parser::OpenMPLoopConstruct>>(
2385-
&loopCons)}) {
2382+
} else if (const auto *innerLoop{std::get_if<
2383+
common::Indirection<parser::OpenMPLoopConstruct>>(
2384+
&loopCons)}) {
23862385
PrivatizeAssociatedLoopIndexAndCheckLoopLevel(innerLoop->value());
23872386
}
23882387

@@ -2391,8 +2390,8 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
23912390
for (const parser::DoConstruct *loop{&*outer}; loop && curLevel > 0;
23922391
--curLevel) {
23932392
if (loop->IsDoConcurrent()) {
2394-
// DO CONCURRENT is explicitly allowed for the LOOP construct so long
2395-
// as there isn't a COLLAPSE clause
2393+
// DO CONCURRENT is explicitly allowed for the LOOP construct so
2394+
// long as there isn't a COLLAPSE clause
23962395
if (isLoopConstruct) {
23972396
if (hasCollapseClause) {
23982397
// hasCollapseClause implies clause != nullptr
@@ -2401,7 +2400,7 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
24012400
}
24022401
} else {
24032402
auto &stmt =
2404-
std::get<parser::Statement<parser::NonLabelDoStmt>>(loop->t);
2403+
std::get<parser::Statement<parser::NonLabelDoStmt>>(loop->t);
24052404
context_.Say(stmt.source,
24062405
"DO CONCURRENT loops cannot form part of a loop nest."_err_en_US);
24072406
}
@@ -2422,26 +2421,26 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
24222421
}
24232422
CheckAssocLoopLevel(curLevel, GetAssociatedClause());
24242423
} else if (const auto *loop{std::get_if<
2425-
common::Indirection<parser::OpenMPLoopConstruct>>(
2426-
innerMostNest)}) {
2424+
common::Indirection<parser::OpenMPLoopConstruct>>(
2425+
innerMostNest)}) {
24272426
const parser::OmpDirectiveSpecification &beginSpec{
2428-
loop->value().BeginDir()};
2427+
loop->value().BeginDir()};
24292428
const parser::OmpDirectiveName &beginName{beginSpec.DirName()};
24302429
if (!llvm::omp::loopTransformationSet.test(beginName.v)) {
24312430
context_.Say(GetContext().directiveSource,
24322431
"Only Loop Transformation Constructs are allowed between an OpenMP Loop Construct and a DO construct"_err_en_US,
24332432
parser::ToUpperCaseLetters(llvm::omp::getOpenMPDirectiveName(
24342433
GetContext().directive, version)
2435-
.str()));
2434+
.str()));
24362435
} else {
24372436
PrivatizeAssociatedLoopIndexAndCheckLoopLevel(loop->value());
24382437
}
24392438
} else {
24402439
context_.Say(GetContext().directiveSource,
24412440
"A DO loop must follow the %s directive"_err_en_US,
2442-
parser::ToUpperCaseLetters(
2443-
llvm::omp::getOpenMPDirectiveName(GetContext().directive, version)
2444-
.str()));
2441+
parser::ToUpperCaseLetters(llvm::omp::getOpenMPDirectiveName(
2442+
GetContext().directive, version)
2443+
.str()));
24452444
}
24462445
}
24472446
}

0 commit comments

Comments
 (0)