Skip to content

Commit bf3f63a

Browse files
committed
delete aro dependency
translate-c is moving towards a package provided by the build system (#20630). The repository https://github.com/ziglang/translate-c/ implements C translation using Aro. This commit deletes the Aro implementation of C translation from the Zig repository, leaving only the Clang implementation. The other dependency on Aro is for the preprocessor. This must move to `std.zig.Preprocessor`, be untangled from Aro, and independently maintained. There must also be added a Preprocessor Build Step, which this commit does not do. Furthermore, the preprocessor must be exposed as a zig compiler JIT command rather than always being compiled into the compiler. This will reduce binary size and time spent waiting for zig to build.
1 parent af5e731 commit bf3f63a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+745
-48830
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,13 @@ set(ZIG_STAGE2_SOURCES
532532
src/arch/arm/Mir.zig
533533
src/arch/arm/abi.zig
534534
src/arch/arm/bits.zig
535-
src/arch/riscv64/abi.zig
536-
src/arch/riscv64/bits.zig
537535
src/arch/riscv64/CodeGen.zig
538536
src/arch/riscv64/Emit.zig
539-
src/arch/riscv64/encoding.zig
540537
src/arch/riscv64/Lower.zig
541538
src/arch/riscv64/Mir.zig
539+
src/arch/riscv64/abi.zig
540+
src/arch/riscv64/bits.zig
541+
src/arch/riscv64/encoding.zig
542542
src/arch/riscv64/mnem.zig
543543
src/arch/sparc64/CodeGen.zig
544544
src/arch/sparc64/Emit.zig
@@ -617,6 +617,7 @@ set(ZIG_STAGE2_SOURCES
617617
src/link/MachO/Object.zig
618618
src/link/MachO/Relocation.zig
619619
src/link/MachO/Symbol.zig
620+
src/link/MachO/Thunk.zig
620621
src/link/MachO/UnwindInfo.zig
621622
src/link/MachO/ZigObject.zig
622623
src/link/MachO/dead_strip.zig
@@ -630,7 +631,6 @@ set(ZIG_STAGE2_SOURCES
630631
src/link/MachO/load_commands.zig
631632
src/link/MachO/relocatable.zig
632633
src/link/MachO/synthetic.zig
633-
src/link/MachO/Thunk.zig
634634
src/link/MachO/uuid.zig
635635
src/link/NvPtx.zig
636636
src/link/Plan9.zig
@@ -668,6 +668,9 @@ set(ZIG_STAGE2_SOURCES
668668
src/target.zig
669669
src/tracy.zig
670670
src/translate_c.zig
671+
src/translate_c/Tokenizer.zig
672+
src/translate_c/aro.zig
673+
src/translate_c/ast.zig
671674
src/wasi_libc.zig
672675
)
673676

@@ -857,10 +860,8 @@ set(BUILD_ZIG2_ARGS
857860
-femit-bin="${ZIG2_C_SOURCE}"
858861
-target "${ZIG_HOST_TARGET_TRIPLE}"
859862
--dep "build_options"
860-
--dep "aro"
861863
"-Mroot=src/main.zig"
862864
"-Mbuild_options=${ZIG_CONFIG_ZIG_OUT}"
863-
"-Maro=lib/compiler/aro/aro.zig"
864865
)
865866

866867
add_custom_command(

build.zig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -668,18 +668,6 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerStepOptions) *std.Build.St
668668
.valgrind = options.valgrind,
669669
});
670670

671-
const aro_mod = b.createModule(.{
672-
.root_source_file = b.path("lib/compiler/aro/aro.zig"),
673-
});
674-
675-
const aro_translate_c_mod = b.createModule(.{
676-
.root_source_file = b.path("lib/compiler/aro_translate_c.zig"),
677-
});
678-
679-
aro_translate_c_mod.addImport("aro", aro_mod);
680-
compiler_mod.addImport("aro", aro_mod);
681-
compiler_mod.addImport("aro_translate_c", aro_translate_c_mod);
682-
683671
const exe = b.addExecutable(.{
684672
.name = "zig",
685673
.max_rss = 7_800_000_000,

lib/compiler/aro/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/compiler/aro/aro.zig

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)