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
This commit is contained in:
Hans Wennborg
2013-12-12 00:06:41 +00:00
parent eb1bac0afa
commit 76eb77dd52
3 changed files with 35 additions and 31 deletions

View File

@@ -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;