[llvm] [NFC][Glob] Escape backslash to fix doxygen rendering (PR #109055)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 14:26:13 PDT 2024


https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/109055

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

>From cd3a7b6115af0d42bd572df9eb46921a8195142e Mon Sep 17 00:00:00 2001
From: Ellis Hoag <ellis.sparky.hoag at gmail.com>
Date: Tue, 17 Sep 2024 14:23:41 -0700
Subject: [PATCH] [NFC][Glob] Escape backslash to fix doxygen rendering

---
 llvm/include/llvm/Support/GlobPattern.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

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



More information about the llvm-commits mailing list