Add -exact-match option to FileCheck to allow clients to do exact matches without using regular expressions.

llvm-svn: 163371
This commit is contained in:
Ted Kremenek 2012-09-07 06:47:16 +00:00
parent b7cd341901
commit 1cb637cc37
1 changed files with 5 additions and 1 deletions

View File

@ -45,6 +45,10 @@ static cl::opt<bool>
NoCanonicalizeWhiteSpace("strict-whitespace",
cl::desc("Do not treat all horizontal whitespace as equivalent"));
static cl::opt<bool>
NoRegex("exact-match",
cl::desc("Look for exact matches without using regular expressions"));
//===----------------------------------------------------------------------===//
// Pattern Handling Code.
//===----------------------------------------------------------------------===//
@ -124,7 +128,7 @@ bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) {
}
// Check to see if this is a fixed string, or if it has regex pieces.
if (PatternStr.size() < 2 ||
if (PatternStr.size() < 2 || NoRegex ||
(PatternStr.find("{{") == StringRef::npos &&
PatternStr.find("[[") == StringRef::npos)) {
FixedStr = PatternStr;