Compare commits

..

No commits in common. "b8645312ebf9d008c877ce3b9f6e1182d40d699e" and "97538fce12e9ec6767a720ded9b5e9a05559f722" have entirely different histories.

4 changed files with 3 additions and 31 deletions

4
.gitignore vendored
View File

@ -8,6 +8,4 @@
/analysis_results /analysis_results
.vscode .vscode
*.log *.log
*tcc_jit*.c tcc_jit*.c
*.disass
*.trc

@ -1 +1 @@
Subproject commit c669f78a90084d55b6a04d41cf7f92558d73e75a Subproject commit 329325fd6d3072f3192b512cc0d1cb02d155b257

@ -1 +1 @@
Subproject commit 2281ec41440d527397541e478bee791da646f827 Subproject commit 60d07f2eb6dafd6294488f4c6b1e2dcbd6c64113

View File

@ -1,26 +0,0 @@
import re
import os
'''
This script takes all files that get dumped by the tcc backend when using the --dump-ir
option and replaces the Integers of addresses with their hex representation to allow
for easier debugging.
'''
current_dir = os.getcwd() # Get the current directory
files_with_tcc_jit = [file for file in os.listdir(current_dir) if"jit" in file and not file.startswith("readable")]
for each in files_with_tcc_jit:
readable_file = f"readable_{each}"
if os.path.exists(readable_file):
os.remove(readable_file)
with open(each, "r") as file:
content = file.read()
for each in files_with_tcc_jit:
with open(each, "r") as file:
content = file.read()
# Replace numbers ending with "U" by their hex representation
content = re.sub(r'\b(\d+)U\b(?=U)?', lambda m: hex(int(m.group(1))), content)
with open(f"readable_{each}", "w") as file:
file.write(content)