[lld] [llvm] [GlobPattern] add AsLiteral to help lld determine if a symbol is literal (PR #215854)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 10:50:43 PDT 2026
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 origin/main HEAD --extensions cpp,h -- lld/MachO/Driver.cpp llvm/include/llvm/Support/GlobPattern.h llvm/lib/Support/GlobPattern.cpp llvm/unittests/Support/GlobPatternTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Support/GlobPattern.cpp b/llvm/lib/Support/GlobPattern.cpp
index 6f78a02af..8eee786c5 100644
--- a/llvm/lib/Support/GlobPattern.cpp
+++ b/llvm/lib/Support/GlobPattern.cpp
@@ -242,8 +242,7 @@ GlobPattern::asLiteral(SmallVectorImpl<char> &Storage) const {
// this pattern denotes a single string is decided by the sub-patterns, which
// recorded it while parsing. No sub-pattern at all means there was no
// metacharacter; more than one means brace expansion produced a choice.
- if (!SubGlobs.empty() &&
- !(SubGlobs.size() == 1 && SubGlobs[0].isLiteral()))
+ if (!SubGlobs.empty() && !(SubGlobs.size() == 1 && SubGlobs[0].isLiteral()))
return std::nullopt;
if (!Pattern.contains('\\'))
``````````
</details>
https://github.com/llvm/llvm-project/pull/215854
More information about the llvm-commits
mailing list