@@ -60,12 +60,12 @@ enum OperandKind {
6060};
6161
6262enum TypeKind {
63- Void = 0 ,
64- Integer ,
65- Ptr ,
66- FunctionTy ,
67- Struct ,
68- UnimplementedType = 255 , // YKFIXME: Will eventually be deleted.
63+ TypeKindVoid = 0 ,
64+ TypeKindInteger ,
65+ TypeKindPtr ,
66+ TypeKindFunction ,
67+ TypeKindStruct ,
68+ TypeKindUnimplemented = 255 , // YKFIXME: Will eventually be deleted.
6969};
7070
7171// A predicate used in a numeric comparison.
@@ -227,8 +227,8 @@ class YkIRWriter {
227227 }
228228
229229 void serialiseOpcode (OpCode Code) { OutStreamer.emitInt8 (Code); }
230-
231230 void serialiseOperandKind (OperandKind Kind) { OutStreamer.emitInt8 (Kind); }
231+ void serialiseTypeKind (TypeKind Kind) { OutStreamer.emitInt8 (Kind); }
232232
233233 void serialiseConstantOperand (Instruction *Parent, llvm::Constant *C) {
234234 serialiseOperandKind (OperandKindConstant);
@@ -715,7 +715,7 @@ class YkIRWriter {
715715 }
716716
717717 void serialiseFunctionType (FunctionType *Ty) {
718- OutStreamer. emitInt8 (TypeKind::FunctionTy );
718+ serialiseTypeKind (TypeKindFunction );
719719 // num_args:
720720 OutStreamer.emitSizeT (Ty->getNumParams ());
721721 // arg_tys:
@@ -729,7 +729,7 @@ class YkIRWriter {
729729 }
730730
731731 void serialiseStructType (StructType *STy) {
732- OutStreamer. emitInt8 (TypeKind::Struct );
732+ serialiseTypeKind (TypeKindStruct );
733733 unsigned NumFields = STy->getNumElements ();
734734 DataLayout DL (&M);
735735 const StructLayout *SL = DL.getStructLayout (STy);
@@ -747,20 +747,20 @@ class YkIRWriter {
747747
748748 void serialiseType (llvm::Type *Ty) {
749749 if (Ty->isVoidTy ()) {
750- OutStreamer. emitInt8 (TypeKind::Void );
750+ serialiseTypeKind (TypeKindVoid );
751751 } else if (PointerType *PT = dyn_cast<PointerType>(Ty)) {
752752 // FIXME: The Yk runtime assumes all pointers are void-ptr-sized.
753753 assert (DL.getPointerSize (PT->getAddressSpace ()) == sizeof (void *));
754- OutStreamer. emitInt8 (TypeKind::Ptr );
754+ serialiseTypeKind (TypeKindPtr );
755755 } else if (IntegerType *ITy = dyn_cast<IntegerType>(Ty)) {
756- OutStreamer. emitInt8 (TypeKind::Integer );
756+ serialiseTypeKind (TypeKindInteger );
757757 OutStreamer.emitInt32 (ITy->getBitWidth ());
758758 } else if (FunctionType *FTy = dyn_cast<FunctionType>(Ty)) {
759759 serialiseFunctionType (FTy);
760760 } else if (StructType *STy = dyn_cast<StructType>(Ty)) {
761761 serialiseStructType (STy);
762762 } else {
763- OutStreamer. emitInt8 (TypeKind::UnimplementedType );
763+ serialiseTypeKind (TypeKindUnimplemented );
764764 serialiseString (toString (Ty));
765765 }
766766 }
0 commit comments