| ... | @@ -254,13 +254,7 @@ pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void { | ... | @@ -254,13 +254,7 @@ pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void { |
| 254 | try cg.module.debugName(func_result_id, nav.fqn.toSlice(ip)); | 254 | try cg.module.debugName(func_result_id, nav.fqn.toSlice(ip)); |
| 255 | }, | 255 | }, |
| 256 | .global => { | 256 | .global => { |
| 257 | const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) { | 257 | assert(ip.indexToKey(val.toIntern()) == .@"extern"); |
| 258 | .func => unreachable, | | |
| 259 | .variable => |variable| .fromInterned(variable.init), | | |
| 260 | .@"extern" => null, | | |
| 261 | else => val, | | |
| 262 | }; | | |
| 263 | assert(maybe_init_val == null); // TODO | | |
| 264 | | 258 | |
| 265 | const storage_class = cg.module.storageClass(nav.getAddrspace()); | 259 | const storage_class = cg.module.storageClass(nav.getAddrspace()); |
| 266 | assert(storage_class != .generic); // These should be instance globals | 260 | assert(storage_class != .generic); // These should be instance globals |
| ... | @@ -274,13 +268,6 @@ pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void { | ... | @@ -274,13 +268,6 @@ pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void { |
| 274 | .storage_class = storage_class, | 268 | .storage_class = storage_class, |
| 275 | }); | 269 | }); |
| 276 | | 270 | |
| 277 | if (nav.getAlignment() != ty.abiAlignment(zcu)) { | | |
| 278 | if (target.os.tag != .opencl) return cg.fail("cannot apply alignment to variables", .{}); | | |
| 279 | try cg.module.decorate(result_id, .{ | | |
| 280 | .alignment = .{ .alignment = @intCast(nav.getAlignment().toByteUnits().?) }, | | |
| 281 | }); | | |
| 282 | } | | |
| 283 | | | |
| 284 | switch (target.os.tag) { | 271 | switch (target.os.tag) { |
| 285 | .vulkan, .opengl => { | 272 | .vulkan, .opengl => { |
| 286 | if (ty.zigTypeTag(zcu) == .@"struct") { | 273 | if (ty.zigTypeTag(zcu) == .@"struct") { |