utility function for conditional code gen.