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 {...@@ -508,11 +508,6 @@ pub const Block = struct {
508 }508 }
509 };509 };
510510
511 /// For debugging purposes.
512 pub fn dump(block: *Block, mod: Module) void {
513 Zir.dumpBlock(mod, block);
514 }
515
516 pub fn makeSubBlock(parent: *Block) Block {511 pub fn makeSubBlock(parent: *Block) Block {
517 return .{512 return .{
518 .parent = parent,513 .parent = parent,
src/Zcu.zig+3-3
...@@ -3127,14 +3127,14 @@ pub fn errNote(...@@ -3127,14 +3127,14 @@ pub fn errNote(
3127/// Deprecated. There is no global target for a Zig Compilation Unit. Instead,3127/// Deprecated. There is no global target for a Zig Compilation Unit. Instead,
3128/// look up the target based on the Module that contains the source code being3128/// look up the target based on the Module that contains the source code being
3129/// analyzed.3129/// analyzed.
3130pub fn getTarget(zcu: Module) Target {3130pub fn getTarget(zcu: *const Zcu) Target {
3131 return zcu.root_mod.resolved_target.result;3131 return zcu.root_mod.resolved_target.result;
3132}3132}
31333133
3134/// Deprecated. There is no global optimization mode for a Zig Compilation3134/// Deprecated. There is no global optimization mode for a Zig Compilation
3135/// Unit. Instead, look up the optimization mode based on the Module that3135/// Unit. Instead, look up the optimization mode based on the Module that
3136/// contains the source code being analyzed.3136/// contains the source code being analyzed.
3137pub fn optimizeMode(zcu: Module) std.builtin.OptimizeMode {3137pub fn optimizeMode(zcu: *const Zcu) std.builtin.OptimizeMode {
3138 return zcu.root_mod.optimize_mode;3138 return zcu.root_mod.optimize_mode;
3139}3139}
31403140
...@@ -3203,7 +3203,7 @@ pub const Feature = enum {...@@ -3203,7 +3203,7 @@ pub const Feature = enum {
3203 separate_thread,3203 separate_thread,
3204};3204};
32053205
3206pub fn backendSupportsFeature(zcu: Module, comptime feature: Feature) bool {3206pub fn backendSupportsFeature(zcu: *const Zcu, comptime feature: Feature) bool {
3207 const backend = target_util.zigBackend(zcu.root_mod.resolved_target.result, zcu.comp.config.use_llvm);3207 const backend = target_util.zigBackend(zcu.root_mod.resolved_target.result, zcu.comp.config.use_llvm);
3208 return target_util.backendSupportsFeature(backend, feature);3208 return target_util.backendSupportsFeature(backend, feature);
3209}3209}