authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2024-07-13 15:31:56-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-13 13:44:39-07:00
log11534aa34d6e9c66081eb2918bfaacbb21db0e56
treebc7f5c2c921b8ce95cb422cf060052dc7d7af202
parentd8c1c9ea6e5ba70e9d7e7ce9b6c6b85f08cd4bca

zcu: fixup incorrect pass-by-value of Zcu


2 files changed, 3 insertions(+), 8 deletions(-)

src/Sema.zig-5
......@@ -508,11 +508,6 @@ pub const Block = struct {
508508 }
509509 };
510510
511 /// For debugging purposes.
512 pub fn dump(block: *Block, mod: Module) void {
513 Zir.dumpBlock(mod, block);
514 }
515
516511 pub fn makeSubBlock(parent: *Block) Block {
517512 return .{
518513 .parent = parent,
src/Zcu.zig+3-3
......@@ -3127,14 +3127,14 @@ pub fn errNote(
31273127/// Deprecated. There is no global target for a Zig Compilation Unit. Instead,
31283128/// look up the target based on the Module that contains the source code being
31293129/// analyzed.
3130pub fn getTarget(zcu: Module) Target {
3130pub fn getTarget(zcu: *const Zcu) Target {
31313131 return zcu.root_mod.resolved_target.result;
31323132}
31333133
31343134/// Deprecated. There is no global optimization mode for a Zig Compilation
31353135/// Unit. Instead, look up the optimization mode based on the Module that
31363136/// contains the source code being analyzed.
3137pub fn optimizeMode(zcu: Module) std.builtin.OptimizeMode {
3137pub fn optimizeMode(zcu: *const Zcu) std.builtin.OptimizeMode {
31383138 return zcu.root_mod.optimize_mode;
31393139}
31403140
......@@ -3203,7 +3203,7 @@ pub const Feature = enum {
32033203 separate_thread,
32043204};
32053205
3206pub fn backendSupportsFeature(zcu: Module, comptime feature: Feature) bool {
3206pub fn backendSupportsFeature(zcu: *const Zcu, comptime feature: Feature) bool {
32073207 const backend = target_util.zigBackend(zcu.root_mod.resolved_target.result, zcu.comp.config.use_llvm);
32083208 return target_util.backendSupportsFeature(backend, feature);
32093209}