[LLVMdev] Regular Expression lib support
Chris Lattner
clattner at apple.com
Sat Aug 29 17:55:24 PDT 2009
On Aug 28, 2009, at 1:53 AM, Daniel Dunbar wrote:
> Nice!
>
> This looks good to me but probably Chris or someone else should sign
> off on it.
This seems ok to me, please commit. One minor comment:
+++ b/lib/Support/Regex.cpp
+ // Allocate pmatch with at least one element.
+ pmatch = new llvm_regmatch_t[nmatch > 0 ? nmatch : 1];
+ pmatch[0].rm_so = 0;
+ pmatch[0].rm_eo = String.size();
Can this be a smallvector to avoid a heap allocation on every match?
-Chris
More information about the llvm-dev
mailing list