[Lldb-commits] [lldb] [lldb][bytecode] Add swift output to Python->bytecode compiler (PR #185773)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 11 14:57:23 PDT 2026
================
@@ -281,13 +287,79 @@ def write_source(self, output: TextIO) -> None:
"__attribute__((used, section(FORMATTER_SECTION)))",
file=output,
)
- print(f"unsigned char _{var_name}_synthetic[] =", file=output)
+ print(f"unsigned char _{var_name}_formatter[] =", file=output)
indent = " "
for string, comment in b.entries:
print(f"{indent}// {comment}", file=output)
print(f"{indent}{string}", file=output)
print(";", file=output)
+ class _SwiftBuilder:
+ """Helper class for emitting binary data as a Swift tuple literal."""
+
+ entries: list[Tuple[bytes, str]]
+
+ def __init__(self) -> None:
+ self.entries = []
+
+ def add_byte(self, x: int, comment: str) -> None:
----------------
adrian-prantl wrote:
In LLVM we would probably call these `emit` instead of `add`.
https://github.com/llvm/llvm-project/pull/185773
More information about the lldb-commits
mailing list