From 8230c40430a1325b5cc5bc0221931487b4bd573c Mon Sep 17 00:00:00 2001 From: rdivacky Date: Wed, 3 Mar 2010 17:27:15 +0000 Subject: Update LLVM to 97654. --- include/llvm/Support/Regex.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/llvm/Support/Regex.h') diff --git a/include/llvm/Support/Regex.h b/include/llvm/Support/Regex.h index c954c0d..591af00 100644 --- a/include/llvm/Support/Regex.h +++ b/include/llvm/Support/Regex.h @@ -56,6 +56,19 @@ namespace llvm { /// /// This returns true on a successful match. bool match(const StringRef &String, SmallVectorImpl *Matches=0); + + /// sub - Return the result of replacing the first match of the regex in + /// \arg String with the \arg Repl string. Backreferences like "\0" in the + /// replacement string are replaced with the appropriate match substring. + /// + /// Note that the replacement string has backslash escaping performed on + /// it. Invalid backreferences are ignored (replaced by empty strings). + /// + /// \param Error If non-null, any errors in the substitution (invalid + /// backreferences, trailing backslashes) will be recorded as a non-empty + /// string. + std::string sub(StringRef Repl, StringRef String, std::string *Error = 0); + private: struct llvm_regex *preg; int error; -- cgit v1.1