zcu: fixup incorrect pass-by-value of Zcu

This commit is contained in:
kcbanner 2024-07-13 15:31:56 -04:00 committed by Andrew Kelley
parent d8c1c9ea6e
commit 11534aa34d
2 changed files with 3 additions and 8 deletions

View File

@ -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 { pub fn makeSubBlock(parent: *Block) Block {
return .{ return .{
.parent = parent, .parent = parent,

View File

@ -3127,14 +3127,14 @@ pub fn errNote(
/// Deprecated. There is no global target for a Zig Compilation Unit. Instead, /// 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 /// look up the target based on the Module that contains the source code being
/// analyzed. /// analyzed.
pub fn getTarget(zcu: Module) Target { pub fn getTarget(zcu: *const Zcu) Target {
return zcu.root_mod.resolved_target.result; return zcu.root_mod.resolved_target.result;
} }
/// Deprecated. There is no global optimization mode for a Zig Compilation /// Deprecated. There is no global optimization mode for a Zig Compilation
/// Unit. Instead, look up the optimization mode based on the Module that /// Unit. Instead, look up the optimization mode based on the Module that
/// contains the source code being analyzed. /// 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; return zcu.root_mod.optimize_mode;
} }
@ -3203,7 +3203,7 @@ pub const Feature = enum {
separate_thread, 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); const backend = target_util.zigBackend(zcu.root_mod.resolved_target.result, zcu.comp.config.use_llvm);
return target_util.backendSupportsFeature(backend, feature); return target_util.backendSupportsFeature(backend, feature);
} }