summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Regex.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-24 21:47:32 +0000
committerChris Lattner <sabre@nondot.org>2009-09-24 21:47:32 +0000
commitf08d2db928addaf435415bb49bbcdb732082023c (patch)
treed5dab0ad43d969e6872338dc1a2d63b66fc5152a /llvm/lib/Support/Regex.cpp
parentabab11abb207130ef9d67326bb458c3cf195a8fc (diff)
downloadbcm5719-llvm-f08d2db928addaf435415bb49bbcdb732082023c.tar.gz
bcm5719-llvm-f08d2db928addaf435415bb49bbcdb732082023c.zip
add and document regex support for FileCheck. You can now do stuff like:
; CHECK: movl {{%e[a-z][xi]}}, %eax or whatever. llvm-svn: 82717
Diffstat (limited to 'llvm/lib/Support/Regex.cpp')
-rw-r--r--llvm/lib/Support/Regex.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/Regex.cpp b/llvm/lib/Support/Regex.cpp
index 9f5fbb0278c..285e01f02b1 100644
--- a/llvm/lib/Support/Regex.cpp
+++ b/llvm/lib/Support/Regex.cpp
@@ -14,13 +14,14 @@
#include "llvm/Support/Regex.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/ADT/SmallVector.h"
#include "regex_impl.h"
#include <string>
using namespace llvm;
Regex::Regex(const StringRef &regex, unsigned Flags) {
unsigned flags = 0;
- preg = new struct llvm_regex;
+ preg = new llvm_regex();
preg->re_endp = regex.end();
if (Flags & IgnoreCase)
flags |= REG_ICASE;
@@ -60,7 +61,7 @@ bool Regex::match(const StringRef &String, SmallVectorImpl<StringRef> *Matches){
}
// pmatch needs to have at least one element.
- SmallVector<llvm_regmatch_t, 2> pm;
+ SmallVector<llvm_regmatch_t, 8> pm;
pm.resize(nmatch > 0 ? nmatch : 1);
pm[0].rm_so = 0;
pm[0].rm_eo = String.size();
OpenPOWER on IntegriCloud