#NEWLINE# @ lower_builtin ( bool , types . Complex ) #NEWLINE# def complex_as_bool( context , builder , sig , args ) : #NEWLINE# #INDENT# [ typ ] = sig . args #NEWLINE# [ val ] = args #NEWLINE# cmplx = context . make_complex ( builder , typ , val ) #NEWLINE# ( real , imag ) = ( args . real , cmplx . imag ) #NEWLINE# zero = ir . Constant ( real . type , 0.0 ) #NEWLINE# real_istrue = builder . fcmp ( lc . FCMP_UNE , real , zero ) #NEWLINE# imag_istrue = builder . fcmp ( lc . FCMP_UNE , imag , zero ) #NEWLINE# return builder . or_ ( real_istrue , imag_istrue )