diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-12-12 00:06:41 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-12-12 00:06:41 +0000 |
commit | 76eb77dd52c4ec215e79e25992f04e3095afe5df (patch) | |
tree | c3c20b39c2f053e6380eb6fd31416825f8b958e7 /include | |
parent | eb1bac0afa78e57bd71a9d8ef98a7f82fb4253a9 (diff) | |
download | llvm-76eb77dd52c4ec215e79e25992f04e3095afe5df.tar.gz llvm-76eb77dd52c4ec215e79e25992f04e3095afe5df.tar.bz2 llvm-76eb77dd52c4ec215e79e25992f04e3095afe5df.tar.xz |
Expose FileCheck's AddFixedStringToRegEx as Regex::escape
Both FileCheck and clang's -verify need to escape strings for regexes,
so let's expose this as a utility in the Regex class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/Regex.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Support/Regex.h b/include/llvm/Support/Regex.h index 3d071bedbd..21677dcfa1 100644 --- a/include/llvm/Support/Regex.h +++ b/include/llvm/Support/Regex.h @@ -81,6 +81,9 @@ namespace llvm { /// expression that matches Str and only Str. static bool isLiteralERE(StringRef Str); + /// \brief Turn String into a regex by escaping its special characters. + static std::string escape(StringRef String); + private: struct llvm_regex *preg; int error; |