mirror of
https://github.com/ziglang/zig.git
synced 2025-01-05 18:00:25 +00:00
stage2: rename llvm.zig to llvm_bindings.zig
Putting functions in this file will create functions like `llvm.function`, and the compiler thinks these are llvm intrinsics.
This commit is contained in:
parent
c81ae52ee0
commit
4a0d64300b
@ -549,7 +549,7 @@ set(ZIG_STAGE2_SOURCES
|
||||
"${CMAKE_SOURCE_DIR}/src/link/cbe.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/link/msdos-stub.bin"
|
||||
"${CMAKE_SOURCE_DIR}/src/liveness.zig"
|
||||
"${CMAKE_SOURCE_DIR}/src/llvm.zig"
|
||||
"${CMAKE_SOURCE_DIR}/src/llvm_bindings.zig"
|
||||
"${CMAKE_SOURCE_DIR}/src/main.zig"
|
||||
"${CMAKE_SOURCE_DIR}/src/mingw.zig"
|
||||
"${CMAKE_SOURCE_DIR}/src/musl.zig"
|
||||
|
@ -567,7 +567,7 @@ pub const File = struct {
|
||||
std.debug.print("\n", .{});
|
||||
}
|
||||
|
||||
const llvm = @import("llvm.zig");
|
||||
const llvm = @import("llvm_bindings.zig");
|
||||
const os_type = @import("target.zig").osToLLVM(base.options.target.os.tag);
|
||||
const bad = llvm.WriteArchive(full_out_path_z, object_files.items.ptr, object_files.items.len, os_type);
|
||||
if (bad) return error.UnableToWriteArchive;
|
||||
|
@ -1676,7 +1676,7 @@ fn buildOutputType(
|
||||
if (build_options.have_llvm and emit_asm != .no) {
|
||||
// LLVM has no way to set this non-globally.
|
||||
const argv = [_][*:0]const u8{ "zig (LLVM option parsing)", "--x86-asm-syntax=intel" };
|
||||
@import("llvm.zig").ParseCommandLineOptions(argv.len, &argv);
|
||||
@import("llvm_bindings.zig").ParseCommandLineOptions(argv.len, &argv);
|
||||
}
|
||||
|
||||
gimmeMoreOfThoseSweetSweetFileDescriptors();
|
||||
@ -2839,7 +2839,7 @@ pub fn punt_to_lld(arena: *Allocator, args: []const []const u8) error{OutOfMemor
|
||||
argv[i] = try arena.dupeZ(u8, arg); // TODO If there was an argsAllocZ we could avoid this allocation.
|
||||
}
|
||||
const exit_code = rc: {
|
||||
const llvm = @import("llvm.zig");
|
||||
const llvm = @import("llvm_bindings.zig");
|
||||
const argc = @intCast(c_int, argv.len);
|
||||
if (mem.eql(u8, args[1], "ld.lld")) {
|
||||
break :rc llvm.LinkELF(argc, argv.ptr, true);
|
||||
@ -3224,7 +3224,7 @@ fn detectNativeTargetInfo(gpa: *Allocator, cross_target: std.zig.CrossTarget) !s
|
||||
if (!build_options.have_llvm)
|
||||
fatal("CPU features detection is not yet available for {} without LLVM extensions", .{@tagName(arch)});
|
||||
|
||||
const llvm = @import("llvm.zig");
|
||||
const llvm = @import("llvm_bindings.zig");
|
||||
const llvm_cpu_name = llvm.GetHostCPUName();
|
||||
const llvm_cpu_features = llvm.GetNativeFeatures();
|
||||
info.target.cpu = try detectNativeCpuWithLLVM(arch, llvm_cpu_name, llvm_cpu_features);
|
||||
|
@ -405,7 +405,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
|
||||
});
|
||||
errdefer comp.gpa.free(lib_final_path);
|
||||
|
||||
const llvm = @import("llvm.zig");
|
||||
const llvm = @import("llvm_bindings.zig");
|
||||
const arch_type = @import("target.zig").archToLLVM(target.cpu.arch);
|
||||
const def_final_path_z = try arena.dupeZ(u8, def_final_path);
|
||||
const lib_final_path_z = try arena.dupeZ(u8, lib_final_path);
|
||||
|
@ -1,5 +1,5 @@
|
||||
const std = @import("std");
|
||||
const llvm = @import("llvm.zig");
|
||||
const llvm = @import("llvm_bindings.zig");
|
||||
|
||||
pub const ArchOsAbi = struct {
|
||||
arch: std.Target.Cpu.Arch,
|
||||
|
Loading…
Reference in New Issue
Block a user