1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00

Add some convenience functions for getting the source and destination

types from any Cast instruction.

llvm-svn: 32807
This commit is contained in:
Reid Spencer 2007-01-02 02:08:27 +00:00
parent 36df2d89f7
commit 2abe7a7078

View File

@ -454,6 +454,11 @@ public:
return Instruction::CastOps(Instruction::getOpcode());
}
/// @brief Return the source type, as a convenience
const Type* getSrcTy() const { return getOperand(0)->getType(); }
/// @brief Return the destination type, as a convenience
const Type* getDestTy() const { return getType(); }
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const CastInst *) { return true; }
static inline bool classof(const Instruction *I) {