diff options
author | Emil Velikov <[email protected]> | 2018-03-20 16:23:05 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2018-03-20 17:21:49 +0000 |
commit | c43715d30b754b6e3e4ea0bfc0f7cee9e403211a (patch) | |
tree | 861a58dbc0c4f71e0f7f6974a815b49279084d46 | |
parent | d3e5d3955c1232aa405cf9ac3af65d4d377fd81a (diff) |
i965: annotate brw_oa.py's --header and --code as required
As of earlier commit, the --header was made a hard requirement when
using --code.
Hence - annotate both as required and drop a few no longer needed
checks.
Fixes: 035cc7a12dc0 ("i965: perf: reduce i965 binary size")
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_oa.py | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_oa.py b/src/mesa/drivers/dri/i965/brw_oa.py index 63db28bba97..b0b2be2af00 100644 --- a/src/mesa/drivers/dri/i965/brw_oa.py +++ b/src/mesa/drivers/dri/i965/brw_oa.py @@ -32,19 +32,16 @@ c_file = None _c_indent = 0 def c(*args): - if c_file: - code = ' '.join(map(str,args)) - for line in code.splitlines(): - text = ''.rjust(_c_indent) + line - c_file.write(text.rstrip() + "\n") + code = ' '.join(map(str,args)) + for line in code.splitlines(): + text = ''.rjust(_c_indent) + line + c_file.write(text.rstrip() + "\n") # indented, but no trailing newline... def c_line_start(code): - if c_file: - c_file.write(''.rjust(_c_indent) + code) + c_file.write(''.rjust(_c_indent) + code) def c_raw(code): - if c_file: - c_file.write(code) + c_file.write(code) def c_indent(n): global _c_indent @@ -57,11 +54,10 @@ header_file = None _h_indent = 0 def h(*args): - if header_file: - code = ' '.join(map(str,args)) - for line in code.splitlines(): - text = ''.rjust(_h_indent) + line - header_file.write(text.rstrip() + "\n") + code = ' '.join(map(str,args)) + for line in code.splitlines(): + text = ''.rjust(_h_indent) + line + header_file.write(text.rstrip() + "\n") def h_indent(n): global _c_indent @@ -556,17 +552,14 @@ def main(): global header_file parser = argparse.ArgumentParser() - parser.add_argument("--header", help="Header file to write") - parser.add_argument("--code", help="C file to write") + parser.add_argument("--header", help="Header file to write", required=True) + parser.add_argument("--code", help="C file to write", required=True) parser.add_argument("xml_files", nargs='+', help="List of xml metrics files to process") args = parser.parse_args() - if args.header: - header_file = open(args.header, 'w') - - if args.code: - c_file = open(args.code, 'w') + header_file = open(args.header, 'w') + c_file = open(args.code, 'w') gens = [] for xml_file in args.xml_files: |