Skip to content

Commit

Permalink
Yk assumes all pointers are the same size as a void *.
Browse files Browse the repository at this point in the history
Assert as such.
  • Loading branch information
vext01 committed Feb 26, 2024
1 parent b5e7855 commit 631dfa6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/YkIR/YkIRWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PointerType>(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<IntegerType>(Ty)) {
OutStreamer.emitInt8(TypeKind::Integer);
Expand Down

0 comments on commit 631dfa6

Please sign in to comment.