3434SPV_EXT_relaxed_printf_string_address_space
3535"""
3636
37- OUTPUT_LANGUAGE = 'c'
38-
3937def make_path_to_file (f ):
4038 """Makes all ancestor directories to the given file, if they don't yet
4139 exist.
@@ -113,10 +111,7 @@ def compose_capability_list(caps):
113111 Returns:
114112 a string containing the braced list of SpvCapability* or spv::Capability:: enums named by caps.
115113 """
116- base_string = 'SpvCapability'
117- global OUTPUT_LANGUAGE
118- if OUTPUT_LANGUAGE == 'c++' :
119- base_string = 'spv::Capability::'
114+ base_string = 'spv::Capability::'
120115
121116 return '{' + ', ' .join ([(base_string + '{}' ).format (c ) for c in caps ]) + '}'
122117
@@ -139,10 +134,7 @@ def generate_capability_arrays(caps):
139134 - caps: a sequence of sequence of capability names
140135 """
141136 caps = sorted (set ([tuple (c ) for c in caps if c ]))
142- cap_str = 'SpvCapability'
143- global OUTPUT_LANGUAGE
144- if OUTPUT_LANGUAGE == 'c++' :
145- cap_str = 'spv::Capability'
137+ cap_str = 'spv::Capability'
146138 arrays = [
147139 'static const ' + cap_str + ' {}[] = {};' .format (
148140 get_capability_array_name (c ), compose_capability_list (c ))
@@ -302,11 +294,7 @@ def fix_syntax(self):
302294 self .operands .pop ()
303295
304296 def __str__ (self ):
305- global OUTPUT_LANGUAGE
306- base_str = 'SpvOp'
307- if OUTPUT_LANGUAGE == 'c++' :
308- base_str = 'spv::Op::Op'
309-
297+ base_str = 'spv::Op::Op'
310298 template = ['{{"{opname}"' , base_str + '{opname}' ,
311299 '{num_aliases}' , '{aliases_mask}' ,
312300 '{num_caps}' , '{caps_mask}' ,
@@ -709,12 +697,8 @@ def generate_capability_to_string_mapping(operand_kinds):
709697
710698 We take care to avoid emitting duplicate values.
711699 """
712- cap_str = 'SpvCapability'
713- cap_join = ''
714- global OUTPUT_LANGUAGE
715- if OUTPUT_LANGUAGE == 'c++' :
716- cap_str = 'spv::Capability'
717- cap_join = '::'
700+ cap_str = 'spv::Capability'
701+ cap_join = '::'
718702
719703 function = 'const char* CapabilityToString(' + cap_str + ' capability) {\n '
720704 function += ' switch (capability) {\n '
@@ -816,10 +800,6 @@ def main():
816800 type = str , required = False , default = None ,
817801 help = 'input JSON grammar file for OpenCL extended '
818802 'instruction set' )
819- parser .add_argument ('--output-language' ,
820- type = str , required = False , default = 'c' ,
821- choices = ['c' ,'c++' ],
822- help = 'specify output language type' )
823803
824804 parser .add_argument ('--core-insts-output' , metavar = '<path>' ,
825805 type = str , required = False , default = None ,
@@ -851,9 +831,6 @@ def main():
851831 help = 'prefix for operand kinds (to disambiguate operand type enums)' )
852832 args = parser .parse_args ()
853833
854- global OUTPUT_LANGUAGE
855- OUTPUT_LANGUAGE = args .output_language
856-
857834 # The GN build system needs this because it doesn't handle quoting
858835 # empty string arguments well.
859836 if args .vendor_operand_kind_prefix == "...nil..." :
0 commit comments