aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-01-24 02:04:51 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2025-02-17 19:17:56 +0100
commitce8c61b0fcb7e0610d4b39728b2d73ed10e762f6 (patch)
tree205013fb60c2e44f153d3b5648fffd50636cc7ed /src/Sema.zig
parent00481668671a8719627922a05a1c143f9d0409ed (diff)
downloadzig-ce8c61b0fcb7e0610d4b39728b2d73ed10e762f6.tar.gz
zig-ce8c61b0fcb7e0610d4b39728b2d73ed10e762f6.zip
std.Target: Move Cpu.Arch.supportsAddressSpace() up to Cpu.
This allows it to inspect CPU features which is needed for Propeller, and AVR in the future.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 1fbec0ecc4..78a7a8f658 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -37244,9 +37244,8 @@ pub fn analyzeAsAddressSpace(
const addrspace_val = try sema.resolveConstDefinedValue(block, src, coerced, .{ .simple = .@"addrspace" });
const address_space = try sema.interpretBuiltinType(block, src, addrspace_val, std.builtin.AddressSpace);
const target = pt.zcu.getTarget();
- const arch = target.cpu.arch;
- if (!arch.supportsAddressSpace(address_space, ctx)) {
+ if (!target.cpu.supportsAddressSpace(address_space, ctx)) {
// TODO error messages could be made more elaborate here
const entity = switch (ctx) {
.function => "functions",
@@ -37258,7 +37257,7 @@ pub fn analyzeAsAddressSpace(
block,
src,
"{s} with address space '{s}' are not supported on {s}",
- .{ entity, @tagName(address_space), arch.genericName() },
+ .{ entity, @tagName(address_space), target.cpu.arch.genericName() },
);
}