| author | |
| committer | |
| log | 340d6ce1bf30556089bdefa60abf50f81617ceb2 |
| tree | 6b85feb49f4fd016e7679b2d15a800925a8d498b |
| parent | af1d777b27641e2dedb70d19e3e4f5b04fa62a6e |
| signature | Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM |
This type has nothing to do with the language.3 files changed, 19 insertions(+), 19 deletions(-)
lib/std/Target.zig+16-1| ... | ... | @@ -2228,6 +2228,21 @@ pub fn requiresLibC(target: *const Target) bool { |
| 2228 | 2228 | }; |
| 2229 | 2229 | } |
| 2230 | 2230 | |
| 2231 | /// The places where a user can specify an address space attribute | |
| 2232 | pub const AddressSpaceContext = enum { | |
| 2233 | /// A function is specified to be placed in a certain address space. | |
| 2234 | function, | |
| 2235 | /// A (global) variable is specified to be placed in a certain address space. In contrast to | |
| 2236 | /// `.constant`, these values (and thus the address space they will be placed in) are required | |
| 2237 | /// to be mutable. | |
| 2238 | variable, | |
| 2239 | /// A (global) constant value is specified to be placed in a certain address space. In contrast | |
| 2240 | /// to `.variable`, values placed in this address space are not required to be mutable. | |
| 2241 | constant, | |
| 2242 | /// A pointer is ascripted to point into a certain address space. | |
| 2243 | pointer, | |
| 2244 | }; | |
| 2245 | ||
| 2231 | 2246 | /// Returns whether this target supports `address_space`. If `context` is `null`, this |
| 2232 | 2247 | /// function simply answers the general question of whether the target has any concept |
| 2233 | 2248 | /// of `address_space`; if non-`null`, the function additionally checks whether |
| ... | ... | @@ -2235,7 +2250,7 @@ pub fn requiresLibC(target: *const Target) bool { |
| 2235 | 2250 | pub fn supportsAddressSpace( |
| 2236 | 2251 | target: Target, |
| 2237 | 2252 | address_space: std.builtin.AddressSpace, |
| 2238 | context: ?std.builtin.AddressSpace.Context, | |
| 2253 | context: ?AddressSpaceContext, | |
| 2239 | 2254 | ) bool { |
| 2240 | 2255 | const arch = target.cpu.arch; |
| 2241 | 2256 |
lib/std/builtin.zig-15| ... | ... | @@ -517,21 +517,6 @@ pub const CallingConvention = union(enum(u8)) { |
| 517 | 517 | /// This data structure is used by the Zig language code generation and |
| 518 | 518 | /// therefore must be kept in sync with the compiler implementation. |
| 519 | 519 | pub const AddressSpace = enum(u5) { |
| 520 | /// The places where a user can specify an address space attribute | |
| 521 | pub const Context = enum { | |
| 522 | /// A function is specified to be placed in a certain address space. | |
| 523 | function, | |
| 524 | /// A (global) variable is specified to be placed in a certain address space. | |
| 525 | /// In contrast to .constant, these values (and thus the address space they will be | |
| 526 | /// placed in) are required to be mutable. | |
| 527 | variable, | |
| 528 | /// A (global) constant value is specified to be placed in a certain address space. | |
| 529 | /// In contrast to .variable, values placed in this address space are not required to be mutable. | |
| 530 | constant, | |
| 531 | /// A pointer is ascripted to point into a certain address space. | |
| 532 | pointer, | |
| 533 | }; | |
| 534 | ||
| 535 | 520 | // CPU address spaces. |
| 536 | 521 | generic, |
| 537 | 522 | gs, |
src/Sema.zig+3-3| ... | ... | @@ -36517,7 +36517,7 @@ fn resolveAddressSpace( |
| 36517 | 36517 | block: *Block, |
| 36518 | 36518 | src: LazySrcLoc, |
| 36519 | 36519 | zir_ref: Zir.Inst.Ref, |
| 36520 | ctx: std.builtin.AddressSpace.Context, | |
| 36520 | ctx: std.Target.AddressSpaceContext, | |
| 36521 | 36521 | ) !std.builtin.AddressSpace { |
| 36522 | 36522 | const air_ref = try sema.resolveInst(zir_ref); |
| 36523 | 36523 | return sema.analyzeAsAddressSpace(block, src, air_ref, ctx); |
| ... | ... | @@ -36528,7 +36528,7 @@ pub fn analyzeAsAddressSpace( |
| 36528 | 36528 | block: *Block, |
| 36529 | 36529 | src: LazySrcLoc, |
| 36530 | 36530 | air_ref: Air.Inst.Ref, |
| 36531 | ctx: std.builtin.AddressSpace.Context, | |
| 36531 | ctx: std.Target.AddressSpaceContext, | |
| 36532 | 36532 | ) !std.builtin.AddressSpace { |
| 36533 | 36533 | const pt = sema.pt; |
| 36534 | 36534 | const addrspace_ty = try sema.getBuiltinType(src, .AddressSpace); |
| ... | ... | @@ -37653,7 +37653,7 @@ pub fn resolveNavPtrModifiers( |
| 37653 | 37653 | }; |
| 37654 | 37654 | |
| 37655 | 37655 | const @"addrspace": std.builtin.AddressSpace = as: { |
| 37656 | const addrspace_ctx: std.builtin.AddressSpace.Context = switch (zir_decl.kind) { | |
| 37656 | const addrspace_ctx: std.Target.AddressSpaceContext = switch (zir_decl.kind) { | |
| 37657 | 37657 | .@"var" => .variable, |
| 37658 | 37658 | else => switch (nav_ty.zigTypeTag(zcu)) { |
| 37659 | 37659 | .@"fn" => .function, |