For PR411:
[oota-llvm.git] / include / llvm / InstrTypes.h
index 50c1e7ab585d2657d905638c2a4fc77e189b90c1..348671a527ab3958d41bb49edb3669a6314b355a 100644 (file)
@@ -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) {