mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 15:13:08 +00:00
addrspace: small cleanups
This commit is contained in:
parent
8385b2c379
commit
2463f4df77
@ -190,10 +190,12 @@ pub const CallingConvention = enum(u8) {
|
|||||||
/// This data structure is used by the Zig language code generation and
|
/// This data structure is used by the Zig language code generation and
|
||||||
/// therefore must be kept in sync with the compiler implementation.
|
/// therefore must be kept in sync with the compiler implementation.
|
||||||
pub const AddressSpace = enum(u5) {
|
pub const AddressSpace = enum(u5) {
|
||||||
|
// CPU address spaces.
|
||||||
generic,
|
generic,
|
||||||
gs,
|
gs,
|
||||||
fs,
|
fs,
|
||||||
ss,
|
ss,
|
||||||
|
|
||||||
// GPU address spaces.
|
// GPU address spaces.
|
||||||
global,
|
global,
|
||||||
constant,
|
constant,
|
||||||
|
|||||||
@ -35631,7 +35631,7 @@ pub fn analyzeAddressSpace(
|
|||||||
ctx: AddressSpaceContext,
|
ctx: AddressSpaceContext,
|
||||||
) !std.builtin.AddressSpace {
|
) !std.builtin.AddressSpace {
|
||||||
const mod = sema.mod;
|
const mod = sema.mod;
|
||||||
const addrspace_tv = try sema.resolveInstConst(block, src, zir_ref, "addresspace must be comptime-known");
|
const addrspace_tv = try sema.resolveInstConst(block, src, zir_ref, "address space must be comptime-known");
|
||||||
const address_space = mod.toEnum(std.builtin.AddressSpace, addrspace_tv.val);
|
const address_space = mod.toEnum(std.builtin.AddressSpace, addrspace_tv.val);
|
||||||
const target = sema.mod.getTarget();
|
const target = sema.mod.getTarget();
|
||||||
const arch = target.cpu.arch;
|
const arch = target.cpu.arch;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user