From 631dfa65ee4582169e03979e8b901f46811db2f7 Mon Sep 17 00:00:00 2001 From: Edd Barrett Date: Mon, 26 Feb 2024 15:05:53 +0000 Subject: [PATCH] Yk assumes all pointers are the same size as a `void *`. Assert as such. --- llvm/lib/YkIR/YkIRWriter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/YkIR/YkIRWriter.cpp b/llvm/lib/YkIR/YkIRWriter.cpp index 4afca0740410c1..0c95664aea3bf1 100644 --- a/llvm/lib/YkIR/YkIRWriter.cpp +++ b/llvm/lib/YkIR/YkIRWriter.cpp @@ -494,7 +494,9 @@ class YkIRWriter { void serialiseType(llvm::Type *Ty) { if (Ty->isVoidTy()) { OutStreamer.emitInt8(TypeKind::Void); - } else if (Ty->isPointerTy()) { + } else if (PointerType *PT = dyn_cast(Ty)) { + // FIXME: The Yk runtime assumes all pointers are void-ptr-sized. + assert(DL.getPointerSize(PT->getAddressSpace()) == sizeof(void *)); OutStreamer.emitInt8(TypeKind::Ptr); } else if (IntegerType *ITy = dyn_cast(Ty)) { OutStreamer.emitInt8(TypeKind::Integer);