aboutsummaryrefslogtreecommitdiff
path: root/scripts/decodetree.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-01-14 09:54:29 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-01-14 09:54:29 +0000
commit7c79721606be11b5bc556449e5bcbc331ef6867d (patch)
tree2b343972665da158053a63decb31a08926842988 /scripts/decodetree.py
parentc0dd6654f207810b16a75b673258f5ce2ceffbf0 (diff)
parent4cacecaaa2bbf8af0967bd3eee43297fada475a9 (diff)
Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210113' into staging
Improvements to tcg constant handling. Force utf8 for decodetree. # gpg: Signature made Thu 14 Jan 2021 02:15:42 GMT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth-gitlab/tags/pull-tcg-20210113: (24 commits) decodetree: Open files with encoding='utf-8' tcg/aarch64: Use tcg_constant_vec with tcg vec expanders tcg/ppc: Use tcg_constant_vec with tcg vec expanders tcg: Remove tcg_gen_dup{8,16,32,64}i_vec tcg/i386: Use tcg_constant_vec with tcg vec expanders tcg: Add tcg_reg_alloc_dup2 tcg: Remove movi and dupi opcodes tcg/tci: Add special tci_movi_{i32,i64} opcodes tcg: Use tcg_constant_{i32,i64,vec} with gvec expanders tcg: Use tcg_constant_{i32,i64} with tcg plugins tcg: Use tcg_constant_{i32,i64} with tcg int expanders tcg: Use tcg_constant_i32 with icount expander tcg: Convert tcg_gen_dupi_vec to TCG_CONST tcg/optimize: Use tcg_constant_internal with constant folding tcg/optimize: Adjust TempOptInfo allocation tcg/optimize: Improve find_better_copy tcg: Introduce TYPE_CONST temporaries tcg: Expand TempOptInfo to 64-bits tcg: Rename struct tcg_temp_info to TempOptInfo tcg: Expand TCGTemp.val to 64-bits ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/decodetree.py')
-rw-r--r--scripts/decodetree.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 47aa9caf6d..4637b633e7 100644
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -20,6 +20,7 @@
# See the syntax and semantics in docs/devel/decodetree.rst.
#
+import io
import os
import re
import sys
@@ -1304,7 +1305,7 @@ def main():
for filename in args:
input_file = filename
- f = open(filename, 'r')
+ f = open(filename, 'rt', encoding='utf-8')
parse_file(f, toppat)
f.close()
@@ -1324,9 +1325,11 @@ def main():
prop_size(stree)
if output_file:
- output_fd = open(output_file, 'w')
+ output_fd = open(output_file, 'wt', encoding='utf-8')
else:
- output_fd = sys.stdout
+ output_fd = io.TextIOWrapper(sys.stdout.buffer,
+ encoding=sys.stdout.encoding,
+ errors="ignore")
output_autogen()
for n in sorted(arguments.keys()):