Re: [patch] Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.h

2015-09-15 Thread Jonathan Wakely
On 14/09/15 21:54 -0700, Tim Shen wrote: As for #ifdef _GLIBCXX_DEBUG, I think it's fine to delete them, since they seem not catching any useful bugs. Sounds good to me.

Re: [patch] Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.h

2015-09-14 Thread Tim Shen
On Mon, Sep 7, 2015 at 8:22 AM, Jonathan Wakely wrote: > And we could get rid of the _Empty type, because std::bitset<0> is an > empty type anyway, so if we made _S_cache_size()==0 when _UseCache is > false then in the current code we could just unconditionally use: > > using _CacheT = std::bitse

Re: [patch] Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.h

2015-09-07 Thread Jonathan Wakely
On 07/09/15 15:54 +0100, Jonathan Wakely wrote: @@ -457,10 +457,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return 1ul << (sizeof(_CharT) * __CHAR_BIT__ * int(_UseCache::value)); } - struct _Dummy { }; - typedef typename std::conditional<_UseCache::value, -

Re: [patch] Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.h

2015-09-07 Thread Jonathan Wakely
We could go further and remove the ABI difference in regex_compiler when using _GLIBCXX_DEBUG, as in the attached patch. The trick is that for the char specialization we have padding bytes between _M_is_non_matching (a bool) and _M_cache (a std::bitset), so we can reuse one of those padding bytes

[patch] Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.h

2015-09-07 Thread Jonathan Wakely
This uses an NSDMI and the _GLIBCXX_DEBUG_ONLY macro to remove several ugly #ifdef _GLIBCXX_DEBUG conditionals in Tested powerpc64le-linux, committed to trunk. commit e53218fa5a7eedf76f409ab41f2e24776bb5195e Author: Jonathan Wakely Date: Mon Sep 7 15:12:03 2015 +0100 Avoid #ifdef _GLIBC