aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2021-08-27 02:48:29 +0200
committerRobin Voetter <robin@voetter.nl>2021-09-20 02:29:04 +0200
commite77fcf17301ad5a68e84cb598984a526cc356621 (patch)
tree76f0b3a4649daa0fb088d0cccc2cab9b56a1adae /src/Sema.zig
parent8672f2696f20e8989d42f69adbe09edfe5cd9332 (diff)
downloadzig-e77fcf17301ad5a68e84cb598984a526cc356621.tar.gz
zig-e77fcf17301ad5a68e84cb598984a526cc356621.zip
Address Spaces: Implement right address space for slicing
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index dfcfde71cc..4b75cc4c43 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -9767,9 +9767,7 @@ fn analyzeSlice(
return_elem_type,
if (end_opt == .none) slice_sentinel else null,
0, // TODO alignment
- // TODO(Snektron) address space, should be inferred from the pointer type.
- // TODO(Snektron) address space for slicing a local, should compute address space from context and architecture.
- .generic,
+ if (ptr_child.zigTypeTag() == .Pointer) ptr_child.ptrAddressSpace() else .generic,
0,
0,
!ptr_child.isConstPtr(),