diff --git a/include/llvm/Instruction.def b/include/llvm/Instruction.def index dac14d33bd2..db41734fa49 100644 --- a/include/llvm/Instruction.def +++ b/include/llvm/Instruction.def @@ -142,18 +142,18 @@ HANDLE_MEMORY_INST(30, GetElementPtr, GetElementPtrInst) // NOTE: The order matters here because CastInst::isEliminableCastPair // NOTE: (see Instructions.cpp) encodes a table based on this ordering. FIRST_CAST_INST(31) -HANDLE_CAST_INST(31, Trunc , CastInst ) // Truncate integers -HANDLE_CAST_INST(32, ZExt , CastInst ) // Zero extend integers -HANDLE_CAST_INST(33, SExt , CastInst ) // Sign extend integers -HANDLE_CAST_INST(34, FPToUI , CastInst ) // floating point -> UInt -HANDLE_CAST_INST(35, FPToSI , CastInst ) // floating point -> SInt -HANDLE_CAST_INST(36, UIToFP , CastInst ) // UInt -> floating point -HANDLE_CAST_INST(37, SIToFP , CastInst ) // SInt -> floating point -HANDLE_CAST_INST(38, FPTrunc , CastInst ) // Truncate floating point -HANDLE_CAST_INST(39, FPExt , CastInst ) // Extend floating point -HANDLE_CAST_INST(40, PtrToInt, CastInst ) // Pointer -> Integer -HANDLE_CAST_INST(41, IntToPtr, CastInst ) // Integer -> Pointer -HANDLE_CAST_INST(42, BitCast , CastInst ) // Type cast +HANDLE_CAST_INST(31, Trunc , TruncInst ) // Truncate integers +HANDLE_CAST_INST(32, ZExt , ZExtInst ) // Zero extend integers +HANDLE_CAST_INST(33, SExt , SExtInst ) // Sign extend integers +HANDLE_CAST_INST(34, FPToUI , FPToUIInst ) // floating point -> UInt +HANDLE_CAST_INST(35, FPToSI , FPToSIInst ) // floating point -> SInt +HANDLE_CAST_INST(36, UIToFP , UIToFPInst ) // UInt -> floating point +HANDLE_CAST_INST(37, SIToFP , SIToFPInst ) // SInt -> floating point +HANDLE_CAST_INST(38, FPTrunc , FPTruncInst ) // Truncate floating point +HANDLE_CAST_INST(39, FPExt , FPExtInst ) // Extend floating point +HANDLE_CAST_INST(40, PtrToInt, PtrToIntInst) // Pointer -> Integer +HANDLE_CAST_INST(41, IntToPtr, IntToPtrInst) // Integer -> Pointer +HANDLE_CAST_INST(42, BitCast , BitCastInst ) // Type cast LAST_CAST_INST(42) // Other operators... diff --git a/include/llvm/Support/InstVisitor.h b/include/llvm/Support/InstVisitor.h index e3103a4c386..f444febce6d 100644 --- a/include/llvm/Support/InstVisitor.h +++ b/include/llvm/Support/InstVisitor.h @@ -177,7 +177,18 @@ public: RetTy visitStoreInst(StoreInst &I) { DELEGATE(Instruction); } RetTy visitGetElementPtrInst(GetElementPtrInst &I){ DELEGATE(Instruction); } RetTy visitPHINode(PHINode &I) { DELEGATE(Instruction); } - RetTy visitCastInst(CastInst &I) { DELEGATE(Instruction); } + RetTy visitTruncInst(TruncInst &I) { DELEGATE(CastInst); } + RetTy visitZExtInst(ZExtInst &I) { DELEGATE(CastInst); } + RetTy visitSExtInst(SExtInst &I) { DELEGATE(CastInst); } + RetTy visitFPTruncInst(FPTruncInst &I) { DELEGATE(CastInst); } + RetTy visitFPExtInst(FPExtInst &I) { DELEGATE(CastInst); } + RetTy visitFPToUIInst(FPToUIInst &I) { DELEGATE(CastInst); } + RetTy visitFPToSIInst(FPToSIInst &I) { DELEGATE(CastInst); } + RetTy visitUIToFPInst(UIToFPInst &I) { DELEGATE(CastInst); } + RetTy visitSIToFPInst(SIToFPInst &I) { DELEGATE(CastInst); } + RetTy visitPtrToIntInst(PtrToIntInst &I) { DELEGATE(CastInst); } + RetTy visitIntToPtrInst(IntToPtrInst &I) { DELEGATE(CastInst); } + RetTy visitBitCastInst(BitCastInst &I) { DELEGATE(CastInst); } RetTy visitSelectInst(SelectInst &I) { DELEGATE(Instruction); } RetTy visitCallInst(CallInst &I) { DELEGATE(Instruction); } RetTy visitShiftInst(ShiftInst &I) { DELEGATE(Instruction); } @@ -194,6 +205,7 @@ public: RetTy visitBinaryOperator(BinaryOperator &I) { DELEGATE(Instruction); } RetTy visitAllocationInst(AllocationInst &I) { DELEGATE(Instruction); } RetTy visitCmpInst(CmpInst &I) { DELEGATE(Instruction); } + RetTy visitCastInst(CastInst &I) { DELEGATE(Instruction); } // If the user wants a 'default' case, they can choose to override this // function. If this function is not overloaded in the users subclass, then