summary refs log tree commit diff stats
path: root/target/hexagon/gen_idef_parser_funcs.py
diff options
context:
space:
mode:
authorMatheus Tavares Bernardino <quic_mathbern@quicinc.com>2023-05-04 13:17:47 -0300
committerTaylor Simpson <tsimpson@quicinc.com>2023-05-18 12:40:52 -0700
commitc3199390c2357f5bf695fa0cbf2b1cfd48ebc5fc (patch)
tree04a46952ac2a8e52823e2b03636fa00b519afdb4 /target/hexagon/gen_idef_parser_funcs.py
parent4354f3dbae3acf6a2116be361e4c497896270518 (diff)
downloadfocaccia-qemu-c3199390c2357f5bf695fa0cbf2b1cfd48ebc5fc.tar.gz
focaccia-qemu-c3199390c2357f5bf695fa0cbf2b1cfd48ebc5fc.zip
Hexagon (target/hexagon/*.py): raise exception on reg parsing error
Currently, the python scripts used for the hexagon building will not
abort the compilation when there is an error parsing a register. Let's
make the compilation properly fail in such cases by rasing an exception
instead of just printing a warning message, which might get lost in the
output.

This patch was generated with:

 git grep -l "Bad register" *hexagon* | \
 xargs sed -i "" -e 's/print("Bad register parse: "[, ]*\([^)]*\))/hex_common.bad_register(\1)/g'

Plus the bad_register() helper added to hex_common.py.

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Tested-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <1f5dbd92f68fdd89e2647e4ba527a2c32cf0f070.1683217043.git.quic_mathbern@quicinc.com>
Diffstat (limited to 'target/hexagon/gen_idef_parser_funcs.py')
-rw-r--r--target/hexagon/gen_idef_parser_funcs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/hexagon/gen_idef_parser_funcs.py b/target/hexagon/gen_idef_parser_funcs.py
index 639458b462..29160fcb1d 100644
--- a/target/hexagon/gen_idef_parser_funcs.py
+++ b/target/hexagon/gen_idef_parser_funcs.py
@@ -147,7 +147,7 @@ def main():
                 elif is_single_new:
                     arguments.append(f"{prefix}{regtype}{regid}N")
                 else:
-                    print("Bad register parse: ", regtype, regid, toss, numregs)
+                    hex_common.bad_register(regtype, regid, toss, numregs)
 
             for immlett, bits, immshift in imms:
                 arguments.append(hex_common.imm_name(immlett))