about summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2023-01-22 23:03:58 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2023-01-22 23:41:39 -0500
commitef5ec771bb4828a8464a4b5ed9ec09b7b48826db (patch)
treeffb5bf1baf0515912fb144f7e5e3639eee39806d
parent739938d7a8981e0b2852d5560b7da51eab66b452 (diff)
downloadrust-ef5ec771bb4828a8464a4b5ed9ec09b7b48826db.tar.gz
rust-ef5ec771bb4828a8464a4b5ed9ec09b7b48826db.zip
abi: add `AddressSpace` field to `Primitive::Pointer`
...and remove it from `PointeeInfo`, which isn't meant for this.

There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string, which will be done in a followup.
-rw-r--r--src/common.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common.rs b/src/common.rs
index 2dcd42fbd8f..63ed10cdfcc 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -35,7 +35,8 @@ pub(crate) fn scalar_to_clif_type(tcx: TyCtxt<'_>, scalar: Scalar) -> Type {
         },
         Primitive::F32 => types::F32,
         Primitive::F64 => types::F64,
-        Primitive::Pointer => pointer_ty(tcx),
+        // FIXME(erikdesjardins): handle non-default addrspace ptr sizes
+        Primitive::Pointer(_) => pointer_ty(tcx),
     }
 }