diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-22 15:53:59 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-22 15:53:59 -0700 |
| commit | f0dcdd7931f1eb4f3b6a0a87c914baf770f6df03 (patch) | |
| tree | 2182e84263410cd093d51c5df6393848f3724b22 /src | |
| parent | 069c83d58cebba88275ee76ba01fabcd8e964573 (diff) | |
| download | zig-f0dcdd7931f1eb4f3b6a0a87c914baf770f6df03.tar.gz zig-f0dcdd7931f1eb4f3b6a0a87c914baf770f6df03.zip | |
stage2: fix Decl addrspace being undefined
Diffstat (limited to 'src')
| -rw-r--r-- | src/Module.zig | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Module.zig b/src/Module.zig index 8677be224f..3ac523bdc5 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -4220,7 +4220,13 @@ fn markOutdatedDecl(mod: *Module, decl: *Decl) !void { decl.analysis = .outdated; } -pub fn allocateNewDecl(mod: *Module, name: [:0]const u8, namespace: *Namespace, src_node: Ast.Node.Index, src_scope: ?*CaptureScope) !*Decl { +pub fn allocateNewDecl( + mod: *Module, + name: [:0]const u8, + namespace: *Namespace, + src_node: Ast.Node.Index, + src_scope: ?*CaptureScope, +) !*Decl { // If we have emit-h then we must allocate a bigger structure to store the emit-h state. const new_decl: *Decl = if (mod.emit_h != null) blk: { const parent_struct = try mod.gpa.create(DeclPlusEmitH); @@ -4242,7 +4248,7 @@ pub fn allocateNewDecl(mod: *Module, name: [:0]const u8, namespace: *Namespace, .val = undefined, .align_val = undefined, .linksection_val = undefined, - .@"addrspace" = undefined, + .@"addrspace" = .generic, .analysis = .unreferenced, .deletion_flag = false, .zir_decl_index = 0, @@ -4346,7 +4352,6 @@ pub fn createAnonymousDeclFromDeclNamed( new_decl.val = typed_value.val; new_decl.align_val = Value.initTag(.null_value); new_decl.linksection_val = Value.initTag(.null_value); - new_decl.@"addrspace" = .generic; // default global addrspace new_decl.has_tv = true; new_decl.analysis = .complete; new_decl.generation = mod.generation; |
