Skip to content

Commit 631dfa6

Browse files
committed
Yk assumes all pointers are the same size as a void *.
Assert as such.
1 parent b5e7855 commit 631dfa6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ class YkIRWriter {
494494
void serialiseType(llvm::Type *Ty) {
495495
if (Ty->isVoidTy()) {
496496
OutStreamer.emitInt8(TypeKind::Void);
497-
} else if (Ty->isPointerTy()) {
497+
} else if (PointerType *PT = dyn_cast<PointerType>(Ty)) {
498+
// FIXME: The Yk runtime assumes all pointers are void-ptr-sized.
499+
assert(DL.getPointerSize(PT->getAddressSpace()) == sizeof(void *));
498500
OutStreamer.emitInt8(TypeKind::Ptr);
499501
} else if (IntegerType *ITy = dyn_cast<IntegerType>(Ty)) {
500502
OutStreamer.emitInt8(TypeKind::Integer);

0 commit comments

Comments
 (0)