[flang-commits] [flang] [flang][OpenMP] Handle multiple spellings in OmpDirectiveNameParser (PR #147722)
via flang-commits
flang-commits at lists.llvm.org
Wed Jul 9 06:18:46 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- flang/lib/Parser/openmp-parsers.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index 29701a616..fdf96dffe 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -126,8 +126,8 @@ private:
using NameWithId = std::pair<std::string, llvm::omp::Directive>;
using ConstIterator = std::vector<NameWithId>::const_iterator;
- llvm::iterator_range<ConstIterator>
- directives_starting_with(char initial) const;
+ llvm::iterator_range<ConstIterator> directives_starting_with(
+ char initial) const;
void initTokens(std::vector<NameWithId>[]) const;
};
@@ -161,9 +161,8 @@ void OmpDirectiveNameParser::initTokens(std::vector<NameWithId> table[]) const {
// order. This is to make sure that longer names are tried first, before
// any potential prefix (e.g. "target update" before "target").
for (int initial{'a'}; initial != 'z' + 1; ++initial) {
- llvm::stable_sort(table[initial - 'a'], [](auto &a, auto &b) {
- return a.first.size() > b.first.size();
- });
+ llvm::stable_sort(table[initial - 'a'],
+ [](auto &a, auto &b) { return a.first.size() > b.first.size(); });
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/147722
More information about the flang-commits
mailing list