summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorSavannah Ostrowski <savannahostrowski@gmail.com>2024-05-03 17:49:51 (GMT)
committerGitHub <noreply@github.com>2024-05-03 17:49:51 (GMT)
commitcb57a52a85a7845b1c017085f05a7f6d71855edc (patch)
treef9994aeba86bc89edc73506f6f604fe8800f1683 /Tools
parentdd8f05fee26cb98770744291a007ceb6b49a5089 (diff)
downloadcpython-cb57a52a85a7845b1c017085f05a7f6d71855edc.zip
cpython-cb57a52a85a7845b1c017085f05a7f6d71855edc.tar.gz
cpython-cb57a52a85a7845b1c017085f05a7f6d71855edc.tar.bz2
GH-118487: Add Black to `.pre-commit-config.yaml` for JIT files (GH-118537)
Diffstat (limited to 'Tools')
-rw-r--r--Tools/jit/_targets.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py
index 23bb189..023ef49 100644
--- a/Tools/jit/_targets.py
+++ b/Tools/jit/_targets.py
@@ -154,13 +154,20 @@ class _Target(typing.Generic[_S, _R]):
args_ll = args + [
# -fomit-frame-pointer is necessary because the GHC calling
# convention uses RBP to pass arguments:
- "-S", "-emit-llvm", "-fomit-frame-pointer", "-o", f"{ll}", f"{c}"
+ "-S",
+ "-emit-llvm",
+ "-fomit-frame-pointer",
+ "-o",
+ f"{ll}",
+ f"{c}",
]
await _llvm.run("clang", args_ll, echo=self.verbose)
ir = ll.read_text()
# This handles declarations, definitions, and calls to named symbols
# starting with "_JIT_":
- ir = re.sub(r"(((noalias|nonnull|noundef) )*ptr @_JIT_\w+\()", r"ghccc \1", ir)
+ ir = re.sub(
+ r"(((noalias|nonnull|noundef) )*ptr @_JIT_\w+\()", r"ghccc \1", ir
+ )
# This handles calls to anonymous callees, since anything with
# "musttail" needs to use the same calling convention:
ir = ir.replace("musttail call", "musttail call ghccc")