[flang-commits] [flang] 8e5b383 - [flang][OpenMP] Rename dirSpec to spec in openmp-parsers.cpp, NFC (#193967)
via flang-commits
flang-commits at lists.llvm.org
Fri Apr 24 06:51:33 PDT 2026
Author: Krzysztof Parzyszek
Date: 2026-04-24T08:51:27-05:00
New Revision: 8e5b38383f1ecb1c93fbe19b6228b45659decf2d
URL: https://github.com/llvm/llvm-project/commit/8e5b38383f1ecb1c93fbe19b6228b45659decf2d
DIFF: https://github.com/llvm/llvm-project/commit/8e5b38383f1ecb1c93fbe19b6228b45659decf2d.diff
LOG: [flang][OpenMP] Rename dirSpec to spec in openmp-parsers.cpp, NFC (#193967)
Added:
Modified:
flang/lib/Parser/openmp-parsers.cpp
Removed:
################################################################################
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index 72089d6cefe1a..7798979ab2a6c 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -1775,10 +1775,10 @@ auto OmpDirectiveSpecificationParser::Parse(ParseState &state) const
return std::nullopt;
}
-static bool IsStandaloneOrdered(const OmpDirectiveSpecification &dirSpec) {
+static bool IsStandaloneOrdered(const OmpDirectiveSpecification &spec) {
// An ORDERED construct is standalone if it has DOACROSS or DEPEND clause.
- return dirSpec.DirId() == llvm::omp::Directive::OMPD_ordered &&
- llvm::any_of(dirSpec.Clauses().v, [](const OmpClause &clause) {
+ return spec.DirId() == llvm::omp::Directive::OMPD_ordered &&
+ llvm::any_of(spec.Clauses().v, [](const OmpClause &clause) {
llvm::omp::Clause id{clause.Id()};
return id == llvm::omp::Clause::OMPC_depend ||
id == llvm::omp::Clause::OMPC_doacross;
@@ -1953,13 +1953,13 @@ struct OmpEndDirectiveParser {
std::optional<resultType> Parse(ParseState &state) const {
if (startOmpLine.Parse(state)) {
if (auto endToken{verbatim("END"_sptok).Parse(state)}) {
- if (auto &&dirSpec{OmpBeginDirectiveParser(dirs_).Parse(state)}) {
+ if (auto &&spec{OmpBeginDirectiveParser(dirs_).Parse(state)}) {
// Extend the "source" on both the OmpDirectiveName and the
// OmpDirectiveNameSpecification.
- CharBlock &nameSource{std::get<OmpDirectiveName>(dirSpec->t).source};
+ CharBlock &nameSource{std::get<OmpDirectiveName>(spec->t).source};
nameSource.ExtendToCover(endToken->source);
- dirSpec->source.ExtendToCover(endToken->source);
- return std::move(*dirSpec);
+ spec->source.ExtendToCover(endToken->source);
+ return std::move(*spec);
}
}
}
@@ -2153,8 +2153,8 @@ struct OmpAtomicConstructParser {
}
recursing_ = true;
- auto dirSpec{OmpDirectiveSpecificationParser{}.Parse(state)};
- if (!dirSpec || dirSpec->DirId() != llvm::omp::Directive::OMPD_atomic) {
+ auto spec{OmpDirectiveSpecificationParser{}.Parse(state)};
+ if (!spec || spec->DirId() != llvm::omp::Directive::OMPD_atomic) {
recursing_ = false;
return std::nullopt;
}
@@ -2172,7 +2172,7 @@ struct OmpAtomicConstructParser {
}
}
recursing_ = false;
- return OpenMPAtomicConstruct{OmpBeginDirective(std::move(*dirSpec)),
+ return OpenMPAtomicConstruct{OmpBeginDirective(std::move(*spec)),
std::move(tail.first),
llvm::transformOptional(std::move(tail.second),
[](auto &&s) { return OmpEndDirective(std::move(s)); })};
More information about the flang-commits
mailing list