diff options
| author | Ted Kremenek <kremenek@apple.com> | 2012-09-07 06:47:16 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2012-09-07 06:47:16 +0000 |
| commit | 1cb637cc37c60a4f18a33f80f56489a5a7602330 (patch) | |
| tree | 4e5826e5b6663bfaadfa3ca438fe1ee5df294844 /llvm/utils | |
| parent | b7cd3419012622fa88ffc9ed1f94ed11c96ac9ce (diff) | |
| download | bcm5719-llvm-1cb637cc37c60a4f18a33f80f56489a5a7602330.tar.gz bcm5719-llvm-1cb637cc37c60a4f18a33f80f56489a5a7602330.zip | |
Add -exact-match option to FileCheck to allow clients to do exact matches without using regular expressions.
llvm-svn: 163371
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 33f04ce6477..0805504ad17 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -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; |

