Skip to content

Commit 2a88a6a

Browse files
authored
Merge pull request #24497 from ziglang/aro-translate-c
compiler: update aro and translate-c to latest; delete clang translate-c
2 parents a73f246 + 5f763b7 commit 2a88a6a

File tree

154 files changed

+43585
-53124
lines changed

Some content is hidden

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

154 files changed

+43585
-53124
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ set(ZIG_CPP_SOURCES
197197
# These are planned to stay even when we are self-hosted.
198198
src/zig_llvm.cpp
199199
src/zig_llvm-ar.cpp
200-
src/zig_clang.cpp
201200
src/zig_clang_driver.cpp
202201
src/zig_clang_cc1_main.cpp
203202
src/zig_clang_cc1as_main.cpp
@@ -502,7 +501,6 @@ set(ZIG_STAGE2_SOURCES
502501
lib/std/zig/Server.zig
503502
lib/std/zig/WindowsSdk.zig
504503
lib/std/zig/Zir.zig
505-
lib/std/zig/c_builtins.zig
506504
lib/std/zig/string_literal.zig
507505
lib/std/zig/system.zig
508506
lib/std/zig/system/NativePaths.zig
@@ -537,7 +535,6 @@ set(ZIG_STAGE2_SOURCES
537535
src/Value.zig
538536
src/Zcu.zig
539537
src/Zcu/PerThread.zig
540-
src/clang.zig
541538
src/clang_options.zig
542539
src/clang_options_data.zig
543540
src/codegen.zig
@@ -641,7 +638,6 @@ set(ZIG_STAGE2_SOURCES
641638
src/register_manager.zig
642639
src/target.zig
643640
src/tracy.zig
644-
src/translate_c.zig
645641
src/libs/wasi_libc.zig
646642
)
647643

build.zig

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ pub fn build(b: *std.Build) !void {
9090
const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false;
9191
const skip_single_threaded = b.option(bool, "skip-single-threaded", "Main test suite skips tests that are single-threaded") orelse false;
9292
const skip_compile_errors = b.option(bool, "skip-compile-errors", "Main test suite skips compile error tests") orelse false;
93-
const skip_translate_c = b.option(bool, "skip-translate-c", "Main test suite skips translate-c tests") orelse false;
94-
const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse skip_translate_c;
9593
const skip_freebsd = b.option(bool, "skip-freebsd", "Main test suite skips targets with freebsd OS") orelse false;
9694
const skip_netbsd = b.option(bool, "skip-netbsd", "Main test suite skips targets with netbsd OS") orelse false;
9795
const skip_windows = b.option(bool, "skip-windows", "Main test suite skips targets with windows OS") orelse false;
@@ -416,7 +414,7 @@ pub fn build(b: *std.Build) !void {
416414
test_step.dependOn(check_fmt);
417415

418416
const test_cases_step = b.step("test-cases", "Run the main compiler test cases");
419-
try tests.addCases(b, test_cases_step, target, .{
417+
try tests.addCases(b, test_cases_step, .{
420418
.test_filters = test_filters,
421419
.test_target_filters = test_target_filters,
422420
.skip_compile_errors = skip_compile_errors,
@@ -428,9 +426,6 @@ pub fn build(b: *std.Build) !void {
428426
.skip_linux = skip_linux,
429427
.skip_llvm = skip_llvm,
430428
.skip_libc = skip_libc,
431-
}, .{
432-
.skip_translate_c = skip_translate_c,
433-
.skip_run_translated_c = skip_run_translated_c,
434429
}, .{
435430
.enable_llvm = enable_llvm,
436431
.llvm_has_m68k = llvm_has_m68k,
@@ -465,28 +460,6 @@ pub fn build(b: *std.Build) !void {
465460
.max_rss = 4000000000,
466461
}));
467462

468-
if (!skip_translate_c) {
469-
test_modules_step.dependOn(tests.addModuleTests(b, .{
470-
.test_filters = test_filters,
471-
.test_target_filters = test_target_filters,
472-
.test_extra_targets = test_extra_targets,
473-
.root_src = "test/c_import.zig",
474-
.name = "c-import",
475-
.desc = "Run the @cImport tests",
476-
.optimize_modes = optimization_modes,
477-
.include_paths = &.{"test/c_import"},
478-
.skip_single_threaded = true,
479-
.skip_non_native = skip_non_native,
480-
.skip_freebsd = skip_freebsd,
481-
.skip_netbsd = skip_netbsd,
482-
.skip_windows = skip_windows,
483-
.skip_macos = skip_macos,
484-
.skip_linux = skip_linux,
485-
.skip_llvm = skip_llvm,
486-
.skip_libc = skip_libc,
487-
}));
488-
}
489-
490463
test_modules_step.dependOn(tests.addModuleTests(b, .{
491464
.test_filters = test_filters,
492465
.test_target_filters = test_target_filters,
@@ -577,7 +550,6 @@ pub fn build(b: *std.Build) !void {
577550
enable_macos_sdk,
578551
enable_ios_sdk,
579552
enable_symlinks_windows,
580-
skip_translate_c,
581553
));
582554
test_step.dependOn(tests.addCAbiTests(b, .{
583555
.test_target_filters = test_target_filters,
@@ -732,13 +704,7 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu
732704
.root_source_file = b.path("lib/compiler/aro/aro.zig"),
733705
});
734706

735-
const aro_translate_c_mod = b.createModule(.{
736-
.root_source_file = b.path("lib/compiler/aro_translate_c.zig"),
737-
});
738-
739-
aro_translate_c_mod.addImport("aro", aro_mod);
740707
compiler_mod.addImport("aro", aro_mod);
741-
compiler_mod.addImport("aro_translate_c", aro_translate_c_mod);
742708

743709
return compiler_mod;
744710
}
@@ -1158,7 +1124,6 @@ fn toNativePathSep(b: *std.Build, s: []const u8) []u8 {
11581124
const zig_cpp_sources = [_][]const u8{
11591125
// These are planned to stay even when we are self-hosted.
11601126
"src/zig_llvm.cpp",
1161-
"src/zig_clang.cpp",
11621127
"src/zig_llvm-ar.cpp",
11631128
"src/zig_clang_driver.cpp",
11641129
"src/zig_clang_cc1_main.cpp",

lib/compiler/aro/README.md

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

lib/compiler/aro/aro.zig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ pub const Driver = @import("aro/Driver.zig");
55
pub const Parser = @import("aro/Parser.zig");
66
pub const Preprocessor = @import("aro/Preprocessor.zig");
77
pub const Source = @import("aro/Source.zig");
8+
pub const StringInterner = @import("aro/StringInterner.zig");
9+
pub const target_util = @import("aro/target.zig");
810
pub const Tokenizer = @import("aro/Tokenizer.zig");
911
pub const Toolchain = @import("aro/Toolchain.zig");
1012
pub const Tree = @import("aro/Tree.zig");
11-
pub const Type = @import("aro/Type.zig");
12-
pub const TypeMapper = @import("aro/StringInterner.zig").TypeMapper;
13-
pub const target_util = @import("aro/target.zig");
13+
pub const TypeStore = @import("aro/TypeStore.zig");
14+
pub const QualType = TypeStore.QualType;
15+
pub const Type = TypeStore.Type;
1416
pub const Value = @import("aro/Value.zig");
1517

1618
const backend = @import("backend.zig");
1719
pub const Interner = backend.Interner;
1820
pub const Ir = backend.Ir;
1921
pub const Object = backend.Object;
2022
pub const CallingConvention = backend.CallingConvention;
23+
pub const Assembly = backend.Assembly;
2124

2225
pub const version_str = backend.version_str;
2326
pub const version = backend.version;
@@ -34,6 +37,5 @@ test {
3437
_ = @import("aro/Preprocessor.zig");
3538
_ = @import("aro/target.zig");
3639
_ = @import("aro/Tokenizer.zig");
37-
_ = @import("aro/toolchains/Linux.zig");
3840
_ = @import("aro/Value.zig");
3941
}

0 commit comments

Comments
 (0)