From 11534aa34d6e9c66081eb2918bfaacbb21db0e56 Mon Sep 17 00:00:00 2001 From: kcbanner Date: Sat, 13 Jul 2024 15:31:56 -0400 Subject: [PATCH] zcu: fixup incorrect pass-by-value of Zcu --- src/Sema.zig | 5 ----- src/Zcu.zig | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Sema.zig b/src/Sema.zig index 896d18d21f..eb49bc037e 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -508,11 +508,6 @@ pub const Block = struct { } }; - /// For debugging purposes. - pub fn dump(block: *Block, mod: Module) void { - Zir.dumpBlock(mod, block); - } - pub fn makeSubBlock(parent: *Block) Block { return .{ .parent = parent, diff --git a/src/Zcu.zig b/src/Zcu.zig index 7351592ec1..6a9812d736 100644 --- a/src/Zcu.zig +++ b/src/Zcu.zig @@ -3127,14 +3127,14 @@ pub fn errNote( /// Deprecated. There is no global target for a Zig Compilation Unit. Instead, /// look up the target based on the Module that contains the source code being /// analyzed. -pub fn getTarget(zcu: Module) Target { +pub fn getTarget(zcu: *const Zcu) Target { return zcu.root_mod.resolved_target.result; } /// Deprecated. There is no global optimization mode for a Zig Compilation /// Unit. Instead, look up the optimization mode based on the Module that /// contains the source code being analyzed. -pub fn optimizeMode(zcu: Module) std.builtin.OptimizeMode { +pub fn optimizeMode(zcu: *const Zcu) std.builtin.OptimizeMode { return zcu.root_mod.optimize_mode; } @@ -3203,7 +3203,7 @@ pub const Feature = enum { separate_thread, }; -pub fn backendSupportsFeature(zcu: Module, comptime feature: Feature) bool { +pub fn backendSupportsFeature(zcu: *const Zcu, comptime feature: Feature) bool { const backend = target_util.zigBackend(zcu.root_mod.resolved_target.result, zcu.comp.config.use_llvm); return target_util.backendSupportsFeature(backend, feature); }