Re: [Patch 1/3] Use manual regex algorithm switching

2014-04-27 Thread Tim Shen
On Sat, Apr 26, 2014 at 10:50 AM, Jonathan Wakely jwak...@redhat.com wrote: This patch is OK, thanks very much. Committed. Thanks! -- Regards, Tim Shen

Re: [Patch 1/3] Use manual regex algorithm switching

2014-04-26 Thread Jonathan Wakely
On 25/04/14 20:50 -0400, Tim Shen wrote: * include/bits/regex.tcc (__regex_algo_impl): Remove _GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT and use _GLIBCXX_REGEX_USE_THOMPSON_NFA instead. * include/bits/regex_automaton.h: Remove quantifier counting variable. *

[Patch 1/3] Use manual regex algorithm switching

2014-04-25 Thread Tim Shen
We used _GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT to control which algorithm we should use; so when compiling a regex, the number of quantifiers(*, +, ?) will be counted and will be used for the algorithm switching. However, I do think give user the manual switch may make things simpler:

Re: [Patch 1/3] Use manual regex algorithm switching

2014-04-25 Thread Jonathan Wakely
--- a/libstdc++-v3/include/bits/regex.tcc +++ b/libstdc++-v3/include/bits/regex.tcc @@ -28,12 +28,12 @@ * Do not attempt to use it directly. @headername{regex} */ -// See below __regex_algo_impl to get what this is talking about. The default -// value 1 indicated a conservative optimization

Re: [Patch 1/3] Use manual regex algorithm switching

2014-04-25 Thread Tim Shen
On Fri, Apr 25, 2014 at 5:14 PM, Jonathan Wakely jwak...@redhat.com wrote: I wonder if this would be simpler to read like this: if (!__re._M_automaton-_M_has_backref #ifndef _GLIBCXX_REGEX_USE_THOMPSON_NFA __policy == _RegexExecutorPolicy::_S_alternate #endif )

Re: [Patch 1/3] Use manual regex algorithm switching

2014-04-25 Thread Jonathan Wakely
On 25/04/14 18:14 -0400, Tim Shen wrote: On Fri, Apr 25, 2014 at 5:14 PM, Jonathan Wakely jwak...@redhat.com wrote: I wonder if this would be simpler to read like this: if (!__re._M_automaton-_M_has_backref #ifndef _GLIBCXX_REGEX_USE_THOMPSON_NFA __policy ==

Re: [Patch 1/3] Use manual regex algorithm switching

2014-04-25 Thread Tim Shen
On Fri, Apr 25, 2014 at 7:56 PM, Jonathan Wakely jwak...@redhat.com wrote: That's why I thought #ifndef would work, not #ifdef Oh I didn't notice that. Now they are equivalent. -- Regards, Tim Shen commit cb39603d6df4763e95a697792e7b45179994f096 Author: tim timshe...@gmail.com Date: Fri Apr