From fbed8555ad409ba74a032baf53ece1c873c2b9a3 Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Mon, 18 Feb 2013 18:49:44 +0000 Subject: [PATCH] Use llvm::cast instead of reinterpret_cast. Also, GetElementPtrInst::getType() method returns SequentialType now, instead of PointerType. There wasn't any issue yet, so no testcase attached. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175452 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Instructions.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/llvm/IR/Instructions.h b/include/llvm/IR/Instructions.h index 324a646bc13..1ae8850cbcc 100644 --- a/include/llvm/IR/Instructions.h +++ b/include/llvm/IR/Instructions.h @@ -91,7 +91,7 @@ public: /// getType - Overload to return most specific pointer type /// PointerType *getType() const { - return reinterpret_cast(Instruction::getType()); + return cast(Instruction::getType()); } /// getAllocatedType - Return the type that is being allocated by the @@ -762,9 +762,9 @@ public: /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); - // getType - Overload to return most specific pointer type... - PointerType *getType() const { - return reinterpret_cast(Instruction::getType()); + // getType - Overload to return most specific sequential type. + SequentialType *getType() const { + return cast(Instruction::getType()); } /// \brief Returns the address space of this instruction's pointer type. @@ -1570,7 +1570,7 @@ public: const Value *getIndexOperand() const { return Op<1>(); } VectorType *getVectorOperandType() const { - return reinterpret_cast(getVectorOperand()->getType()); + return cast(getVectorOperand()->getType()); } @@ -1629,7 +1629,7 @@ public: /// getType - Overload to return most specific vector type. /// VectorType *getType() const { - return reinterpret_cast(Instruction::getType()); + return cast(Instruction::getType()); } /// Transparently provide more efficient getOperand methods. @@ -1681,14 +1681,14 @@ public: /// getType - Overload to return most specific vector type. /// VectorType *getType() const { - return reinterpret_cast(Instruction::getType()); + return cast(Instruction::getType()); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); Constant *getMask() const { - return reinterpret_cast(getOperand(2)); + return cast(getOperand(2)); } /// getMaskValue - Return the index from the shuffle mask for the specified -- 2.34.1