Skip to content

Commit 2234bb6

Browse files
bors[bot]vext01
andauthored
85: Serialise the void type. r=ltratt a=vext01 Co-authored-by: Edd Barrett <[email protected]>
2 parents 0cc0d20 + 71b21ed commit 2234bb6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ enum OperandKind {
5555
};
5656

5757
enum TypeKind {
58-
Integer = 0,
58+
Void = 0,
59+
Integer,
5960
UnimplementedType = 255, // YKFIXME: Will eventually be deleted.
6061
};
6162

@@ -235,7 +236,9 @@ class YkIRWriter {
235236
}
236237

237238
void serialiseType(Type *Ty) {
238-
if (IntegerType *ITy = dyn_cast<IntegerType>(Ty)) {
239+
if (Ty->isVoidTy()) {
240+
OutStreamer.emitInt8(TypeKind::Void);
241+
} else if (IntegerType *ITy = dyn_cast<IntegerType>(Ty)) {
239242
OutStreamer.emitInt8(TypeKind::Integer);
240243
OutStreamer.emitInt32(ITy->getBitWidth());
241244
} else {

0 commit comments

Comments
 (0)