From 9c4d5e64b45001cd82c0db53d1a489f433024223 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Mon, 17 Jul 2023 20:17:43 -0400 Subject: [PATCH] llvm: minor fixes --- src/codegen/llvm.zig | 2 +- src/codegen/llvm/Builder.zig | 2 +- src/main.zig | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 7fe5dbb88f..8c5660f8c5 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -8,7 +8,7 @@ const native_endian = builtin.cpu.arch.endian(); const DW = std.dwarf; const Builder = @import("llvm/Builder.zig"); -const llvm = if (build_options.have_llvm) +const llvm = if (build_options.have_llvm or true) @import("llvm/bindings.zig") else @compileError("LLVM unavailable"); diff --git a/src/codegen/llvm/Builder.zig b/src/codegen/llvm/Builder.zig index 67bafc0113..1ff0ea6976 100644 --- a/src/codegen/llvm/Builder.zig +++ b/src/codegen/llvm/Builder.zig @@ -6644,7 +6644,7 @@ fn bigIntConstAssumeCapacity( } else |_| { const llvm_limbs = try allocator.alloc(u64, std.math.divCeil( usize, - canonical_value.bitCountTwosComp(), + if (canonical_value.positive) canonical_value.bitCountAbs() else bits, @bitSizeOf(u64), ) catch unreachable); defer allocator.free(llvm_limbs); diff --git a/src/main.zig b/src/main.zig index 59655eadb6..134b566bdc 100644 --- a/src/main.zig +++ b/src/main.zig @@ -439,8 +439,8 @@ const usage_build_generic = \\ -fno-unwind-tables Never produce unwind table entries \\ -fLLVM Force using LLVM as the codegen backend \\ -fno-LLVM Prevent using LLVM as the codegen backend - \\ -flibLLVM Force using LLVM shared library apias the codegen backend - \\ -fno-libLLVM Prevent using LLVM as the codegen backend + \\ -flibLLVM Force using the LLVM API in the codegen backend + \\ -fno-libLLVM Prevent using the LLVM API in the codegen backend \\ -fClang Force using Clang as the C/C++ compilation backend \\ -fno-Clang Prevent using Clang as the C/C++ compilation backend \\ -freference-trace[=num] How many lines of reference trace should be shown per compile error