diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-03-26 15:50:31 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-10-18 11:13:28 +0200 |
| commit | f3da54f53c1db1484b00657de18e3677358549cd (patch) | |
| tree | e356155b2f652c7a434ada3e3600529ef1a41e4b /src/target.zig | |
| parent | 631915ad961c83b8a2e4e36f11a278dae054372e (diff) | |
| download | zig-f3da54f53c1db1484b00657de18e3677358549cd.tar.gz zig-f3da54f53c1db1484b00657de18e3677358549cd.zip | |
std.Target: move Cpu.supportsAddressSpace() up to here
This allows us to rule out support for certain address spaces based on the OS.
This commit is just a refactor, however, and doesn't actually make use of that
opportunity yet.
Diffstat (limited to 'src/target.zig')
| -rw-r--r-- | src/target.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/target.zig b/src/target.zig index 12af14de9d..3a1b9f93af 100644 --- a/src/target.zig +++ b/src/target.zig @@ -539,10 +539,10 @@ pub fn addrSpaceCastIsValid( to: AddressSpace, ) bool { switch (target.cpu.arch) { - .x86_64, .x86 => return target.cpu.supportsAddressSpace(from, null) and target.cpu.supportsAddressSpace(to, null), + .x86_64, .x86 => return target.supportsAddressSpace(from, null) and target.supportsAddressSpace(to, null), .nvptx64, .nvptx, .amdgcn => { - const to_generic = target.cpu.supportsAddressSpace(from, null) and to == .generic; - const from_generic = target.cpu.supportsAddressSpace(to, null) and from == .generic; + const to_generic = target.supportsAddressSpace(from, null) and to == .generic; + const from_generic = target.supportsAddressSpace(to, null) and from == .generic; return to_generic or from_generic; }, else => return from == .generic and to == .generic, |
