[flang-commits] [flang] [flang][OpenMP] Rename dirSpec to spec in openmp-parsers.cpp, NFC (PR #193967)

via flang-commits flang-commits at lists.llvm.org
Fri Apr 24 06:34:52 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-parser

Author: Krzysztof Parzyszek (kparzysz)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/193967.diff


1 Files Affected:

- (modified) flang/lib/Parser/openmp-parsers.cpp (+10-10) 


``````````diff
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)); })};

``````````

</details>


https://github.com/llvm/llvm-project/pull/193967


More information about the flang-commits mailing list