[llvm-commits] [llvm] r163371 - /llvm/trunk/utils/FileCheck/FileCheck.cpp
Ted Kremenek
kremenek at apple.com
Thu Sep 6 23:47:16 PDT 2012
Author: kremenek
Date: Fri Sep 7 01:47:16 2012
New Revision: 163371
URL: http://llvm.org/viewvc/llvm-project?rev=163371&view=rev
Log:
Add -exact-match option to FileCheck to allow clients to do exact matches without using regular expressions.
Modified:
llvm/trunk/utils/FileCheck/FileCheck.cpp
Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=163371&r1=163370&r2=163371&view=diff
==============================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp Fri Sep 7 01:47:16 2012
@@ -45,6 +45,10 @@
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 @@
}
// 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;
More information about the llvm-commits
mailing list