[llvm] [NFC][Glob] Escape backslash to fix doxygen rendering (PR #109055)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 14:26:49 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: Ellis Hoag (ellishg)
<details>
<summary>Changes</summary>
The docs for Glob wasn't rendered correctly, I believe because the `\` was not properly escaped. I haven't built these docs locally, so I'll follow up to see if this is fixed after it lands.
https://llvm.org/doxygen/classllvm_1_1GlobPattern.html
---
Full diff: https://github.com/llvm/llvm-project/pull/109055.diff
1 Files Affected:
- (modified) llvm/include/llvm/Support/GlobPattern.h (+4-5)
``````````diff
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index 1a722e65bed802..eff8957d1b682e 100644
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -34,8 +34,8 @@ namespace llvm {
/// expansions are not supported. If \p MaxSubPatterns is empty then
/// brace expansions are not supported and characters \p "{,}" are treated as
/// literals.
-/// * \p "\" escapes the next character so it is treated as a literal.
-///
+/// * \p "\\" (a single backslash) escapes the next character so it is treated
+/// as a literal.
///
/// Some known edge cases are:
/// * \p "]" is allowed as the first character in a character class, i.e.,
@@ -45,9 +45,8 @@ namespace llvm {
/// * \p "}" and \p "," that are not inside a brace expansion are taken as
/// literals, e.g., \p ",}" is valid but \p "{" is not.
///
-///
-/// For example, \p "*[/\\]foo.{c,cpp}" will match (unix or windows) paths to
-/// all files named \p "foo.c" or \p "foo.cpp".
+/// For example, \p "*[/\\\\]foo.{c,cpp}" (with two backslashes) will match
+/// (unix or windows) paths to all files named \p "foo.c" or \p "foo.cpp".
class GlobPattern {
public:
/// \param Pat the pattern to match against
``````````
</details>
https://github.com/llvm/llvm-project/pull/109055
More information about the llvm-commits
mailing list