MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / remove_debug_info

Function remove_debug_info

test/diff/diff_files/generate_tests.py:108–127  ·  view source on GitHub ↗
(in_path)

Source from the content-addressed store, hash-verified

106 print("Usage: {} <path-to-spirv-diff>".format(sys.argv[0]))
107
108def remove_debug_info(in_path):
109 tmp_dir = '.no_dbg'
110
111 if not os.path.exists(tmp_dir):
112 os.makedirs(tmp_dir)
113
114 (in_basename, in_ext) = os.path.splitext(in_path)
115 out_name = in_basename + '_no_dbg' + in_ext
116 out_path = os.path.join(tmp_dir, out_name)
117
118 with open(in_path, 'r') as fin:
119 with open(out_path, 'w') as fout:
120 for line in fin:
121 ops = line.strip().split()
122 op = ops[0] if len(ops) > 0 else ''
123 if (op != ';;' and op != 'OpName' and op != 'OpMemberName' and op != 'OpString' and
124 op != 'OpLine' and op != 'OpNoLine' and op != 'OpModuleProcessed'):
125 fout.write(line)
126
127 return out_path
128
129def make_src_file(test_name):
130 return '{}_src.spvasm'.format(test_name)

Callers 1

generate_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected