Split check_builtin_constant_p override
This commit is contained in:
parent
1ab55f7551
commit
08f6653fcd
|
@ -1157,6 +1157,7 @@ gcc-4.8.
|
||||||
if Compile(context, text=include, main=_main, msg='whether compiler implements __builtin_bswap{16,32,64} functions', successflags=_successflags_bswap16) or \
|
if Compile(context, text=include, main=_main, msg='whether compiler implements __builtin_bswap{16,32,64} functions', successflags=_successflags_bswap16) or \
|
||||||
Compile(context, text=include, main=_main, msg='whether compiler implements __builtin_bswap{32,64} functions', successflags=_successflags_bswap):
|
Compile(context, text=include, main=_main, msg='whether compiler implements __builtin_bswap{32,64} functions', successflags=_successflags_bswap):
|
||||||
return
|
return
|
||||||
|
implicit_tests.append(_implicit_test.RecordedTest('check_optimize_builtin_constant_p', "assume compiler optimizes __builtin_constant_p"))
|
||||||
@_custom_test
|
@_custom_test
|
||||||
def check_builtin_constant_p(self,context):
|
def check_builtin_constant_p(self,context):
|
||||||
"""
|
"""
|
||||||
|
@ -1184,7 +1185,7 @@ static int a(int b){
|
||||||
'''
|
'''
|
||||||
main = 'return a(1) + a(2)'
|
main = 'return a(1) + a(2)'
|
||||||
Define = context.sconf.Define
|
Define = context.sconf.Define
|
||||||
if self.Link(context, text=f % 'c(b)', main=main, msg='whether compiler optimizes __builtin_constant_p'):
|
if self.Link(context, text=f % 'c(b)', main=main, msg='whether compiler optimizes __builtin_constant_p', calling_function='optimize_builtin_constant_p'):
|
||||||
Define('DXX_HAVE_BUILTIN_CONSTANT_P')
|
Define('DXX_HAVE_BUILTIN_CONSTANT_P')
|
||||||
Define('DXX_CONSTANT_TRUE(E)', '(__builtin_constant_p((E)) && (E))')
|
Define('DXX_CONSTANT_TRUE(E)', '(__builtin_constant_p((E)) && (E))')
|
||||||
dxx_builtin_constant_p = '__builtin_constant_p(A)'
|
dxx_builtin_constant_p = '__builtin_constant_p(A)'
|
||||||
|
|
|
@ -306,7 +306,7 @@ static inline void _gr_set_current_canvas_inline(grs_canvas *canv)
|
||||||
static inline void gr_set_current_canvas(grs_canvas *canv)
|
static inline void gr_set_current_canvas(grs_canvas *canv)
|
||||||
{
|
{
|
||||||
#ifdef DXX_HAVE_BUILTIN_CONSTANT_P
|
#ifdef DXX_HAVE_BUILTIN_CONSTANT_P
|
||||||
if (__builtin_constant_p(!canv))
|
if (dxx_builtin_constant_p(!canv))
|
||||||
_gr_set_current_canvas_inline(canv);
|
_gr_set_current_canvas_inline(canv);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -506,7 +506,7 @@ void multi_send_endlevel_start();
|
||||||
static inline void multi_send_endlevel_start(bool secret)
|
static inline void multi_send_endlevel_start(bool secret)
|
||||||
{
|
{
|
||||||
#ifdef DXX_HAVE_BUILTIN_CONSTANT_P
|
#ifdef DXX_HAVE_BUILTIN_CONSTANT_P
|
||||||
if (!__builtin_constant_p(secret) || secret)
|
if (!dxx_builtin_constant_p(!!secret) || secret)
|
||||||
DXX_ALWAYS_ERROR_FUNCTION(multi_send_endlevel_start_with_secret, "secret not supported in Descent II");
|
DXX_ALWAYS_ERROR_FUNCTION(multi_send_endlevel_start_with_secret, "secret not supported in Descent II");
|
||||||
#endif
|
#endif
|
||||||
(void)secret;
|
(void)secret;
|
||||||
|
|
Loading…
Reference in a new issue