Skip to content

Commit cc25ac4

Browse files
authored
[flang][OpenMP] Use DirId() instead of DirName().v, NFC (#171484)
1 parent 93d2ef1 commit cc25ac4

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

flang/lib/Parser/openmp-parsers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,7 @@ struct OmpLoopConstructParser {
19201920
auto loopItem{LoopNestParser{} || ompLoopConstruct};
19211921

19221922
if (auto &&begin{OmpBeginDirectiveParser(dirs_).Parse(state)}) {
1923-
auto loopDir{begin->DirName().v};
1923+
auto loopDir{begin->DirId()};
19241924
auto assoc{llvm::omp::getDirectiveAssociation(loopDir)};
19251925
if (assoc == llvm::omp::Association::LoopNest) {
19261926
if (auto &&item{attempt(loopItem).Parse(state)}) {

flang/lib/Semantics/check-omp-loop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void OmpStructureChecker::CheckNestedBlock(const parser::OpenMPLoopConstruct &x,
271271
} else if (parser::Unwrap<parser::DoConstruct>(stmt)) {
272272
++nestedCount;
273273
} else if (auto *omp{parser::Unwrap<parser::OpenMPLoopConstruct>(stmt)}) {
274-
if (!IsLoopTransforming(omp->BeginDir().DirName().v)) {
274+
if (!IsLoopTransforming(omp->BeginDir().DirId())) {
275275
context_.Say(omp->source,
276276
"Only loop-transforming OpenMP constructs are allowed inside OpenMP loop constructs"_err_en_US);
277277
}
@@ -324,7 +324,7 @@ void OmpStructureChecker::CheckFullUnroll(
324324
// since it won't contain a loop.
325325
if (const parser::OpenMPLoopConstruct *nested{x.GetNestedConstruct()}) {
326326
auto &nestedSpec{nested->BeginDir()};
327-
if (nestedSpec.DirName().v == llvm::omp::Directive::OMPD_unroll) {
327+
if (nestedSpec.DirId() == llvm::omp::Directive::OMPD_unroll) {
328328
bool isPartial{
329329
llvm::any_of(nestedSpec.Clauses().v, [](const parser::OmpClause &c) {
330330
return c.Id() == llvm::omp::Clause::OMPC_partial;

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,7 @@ void OmpStructureChecker::Leave(const parser::OpenMPCancelConstruct &) {
28002800
void OmpStructureChecker::Enter(const parser::OpenMPCriticalConstruct &x) {
28012801
const parser::OmpBeginDirective &beginSpec{x.BeginDir()};
28022802
const std::optional<parser::OmpEndDirective> &endSpec{x.EndDir()};
2803-
PushContextAndClauseSets(beginSpec.DirName().source, beginSpec.DirName().v);
2803+
PushContextAndClauseSets(beginSpec.DirName().source, beginSpec.DirId());
28042804

28052805
const auto &block{std::get<parser::Block>(x.t)};
28062806
CheckNoBranching(

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPSectionConstruct &x) {
24772477

24782478
bool OmpAttributeVisitor::Pre(const parser::OpenMPCriticalConstruct &x) {
24792479
const parser::OmpBeginDirective &beginSpec{x.BeginDir()};
2480-
PushContext(beginSpec.DirName().source, beginSpec.DirName().v);
2480+
PushContext(beginSpec.DirName().source, beginSpec.DirId());
24812481
GetContext().withinConstruct = true;
24822482
return true;
24832483
}

flang/lib/Semantics/rewrite-parse-tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static bool ReturnsDataPointer(const Symbol &symbol) {
118118
}
119119

120120
static bool LoopConstructIsSIMD(parser::OpenMPLoopConstruct *ompLoop) {
121-
return llvm::omp::allSimdSet.test(ompLoop->BeginDir().DirName().v);
121+
return llvm::omp::allSimdSet.test(ompLoop->BeginDir().DirId());
122122
}
123123

124124
// Remove non-SIMD OpenMPConstructs once they are parsed.

0 commit comments

Comments
 (0)