From 528700863adefca8de461ce28a7d903729fb96b4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 24 Sep 2009 21:47:32 +0000 Subject: add and document regex support for FileCheck. You can now do stuff like: ; CHECK: movl {{%e[a-z][xi]}}, %eax or whatever. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82717 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Regex.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Support/Regex.cpp') diff --git a/lib/Support/Regex.cpp b/lib/Support/Regex.cpp index 9f5fbb0278..285e01f02b 100644 --- a/lib/Support/Regex.cpp +++ b/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 using namespace llvm; Regex::Regex(const StringRef ®ex, 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 *Matches){ } // pmatch needs to have at least one element. - SmallVector pm; + SmallVector pm; pm.resize(nmatch > 0 ? nmatch : 1); pm[0].rm_so = 0; pm[0].rm_eo = String.size(); -- cgit v1.2.3-18-g5258