From 0a11af1f73916b53cd4eb4ebac37527facd9cf3b Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 17 Jan 2007 02:46:11 +0000 Subject: For PR1117: Expose the previously hidden checkCast function as CastInst::castIsValid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33282 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/InstrTypes.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 50c1e7a..348671a 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -459,6 +459,12 @@ public: /// @brief Return the destination type, as a convenience const Type* getDestTy() const { return getType(); } + /// This method can be used to determine if a cast from S to DstTy using + /// Opcode op is valid or not. + /// @returns true iff the proposed cast is valid. + /// @brief Determine if a cast is valid without creating one. + static bool castIsValid(Instruction::CastOps op, Value *S, const Type *DstTy); + /// @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) { -- cgit v1.1