aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-03-16 01:32:43 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-03-17 01:57:14 -0400
commitcfcd6698cd9385938df27a2052c2309229171e4f (patch)
tree3ac0ce351109462a9f0e96c5f06fe94737be48a8 /src/Compilation.zig
parent4ec299007a6a183edddfcb0505a9c1501da7ad0c (diff)
downloadzig-cfcd6698cd9385938df27a2052c2309229171e4f.tar.gz
zig-cfcd6698cd9385938df27a2052c2309229171e4f.zip
main: add debug option to dump unoptimized llvm ir
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 89512ce744..858afb6ca3 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -86,7 +86,8 @@ clang_preprocessor_mode: ClangPreprocessorMode,
/// Whether to print clang argvs to stdout.
verbose_cc: bool,
verbose_air: bool,
-verbose_llvm_ir: bool,
+verbose_llvm_ir: ?[]const u8,
+verbose_llvm_bc: ?[]const u8,
verbose_cimport: bool,
verbose_llvm_cpu_features: bool,
disable_c_depfile: bool,
@@ -585,7 +586,8 @@ pub const InitOptions = struct {
verbose_cc: bool = false,
verbose_link: bool = false,
verbose_air: bool = false,
- verbose_llvm_ir: bool = false,
+ verbose_llvm_ir: ?[]const u8 = null,
+ verbose_llvm_bc: ?[]const u8 = null,
verbose_cimport: bool = false,
verbose_llvm_cpu_features: bool = false,
is_test: bool = false,
@@ -1559,6 +1561,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.verbose_cc = options.verbose_cc,
.verbose_air = options.verbose_air,
.verbose_llvm_ir = options.verbose_llvm_ir,
+ .verbose_llvm_bc = options.verbose_llvm_bc,
.verbose_cimport = options.verbose_cimport,
.verbose_llvm_cpu_features = options.verbose_llvm_cpu_features,
.disable_c_depfile = options.disable_c_depfile,
@@ -5342,6 +5345,7 @@ fn buildOutputFromZig(
.verbose_link = comp.bin_file.options.verbose_link,
.verbose_air = comp.verbose_air,
.verbose_llvm_ir = comp.verbose_llvm_ir,
+ .verbose_llvm_bc = comp.verbose_llvm_bc,
.verbose_cimport = comp.verbose_cimport,
.verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features,
.clang_passthrough_mode = comp.clang_passthrough_mode,
@@ -5419,6 +5423,7 @@ pub fn build_crt_file(
.verbose_link = comp.bin_file.options.verbose_link,
.verbose_air = comp.verbose_air,
.verbose_llvm_ir = comp.verbose_llvm_ir,
+ .verbose_llvm_bc = comp.verbose_llvm_bc,
.verbose_cimport = comp.verbose_cimport,
.verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features,
.clang_passthrough_mode = comp.clang_passthrough_mode,