diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-30 22:02:14 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-30 22:02:14 +0000 |
commit | b4019ae13c4a05d9cb7c4f2ce9b1ae89ea094d45 (patch) | |
tree | 9cb7e36c2af4a05a1f8deaf5e4b5f674905152ab /llvm/include | |
parent | 7ae6ffd3d259685bbcfdd9f227f5fc5854d63bbd (diff) | |
download | bcm5719-llvm-b4019ae13c4a05d9cb7c4f2ce9b1ae89ea094d45.tar.gz bcm5719-llvm-b4019ae13c4a05d9cb7c4f2ce9b1ae89ea094d45.zip |
Revert "Remove isCastable since nothing uses it now"
Apparently dragonegg uses it.
llvm-svn: 187454
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/IR/InstrTypes.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h index e32af766ca8..e12bb03a403 100644 --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -209,7 +209,7 @@ public: BO->setHasNoSignedWrap(true); return BO; } - + static BinaryOperator *CreateNUW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name = "") { BinaryOperator *BO = Create(Opc, V1, V2, Name); @@ -228,7 +228,7 @@ public: BO->setHasNoUnsignedWrap(true); return BO; } - + static BinaryOperator *CreateExact(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name = "") { BinaryOperator *BO = Create(Opc, V1, V2, Name); @@ -247,7 +247,7 @@ public: BO->setIsExact(true); return BO; } - + #define DEFINE_HELPERS(OPC, NUWNSWEXACT) \ static BinaryOperator *Create ## NUWNSWEXACT ## OPC \ (Value *V1, Value *V2, const Twine &Name = "") { \ @@ -261,7 +261,7 @@ public: (Value *V1, Value *V2, const Twine &Name, Instruction *I) { \ return Create ## NUWNSWEXACT(Instruction::OPC, V1, V2, Name, I); \ } - + DEFINE_HELPERS(Add, NSW) // CreateNSWAdd DEFINE_HELPERS(Add, NUW) // CreateNUWAdd DEFINE_HELPERS(Sub, NSW) // CreateNSWSub @@ -277,7 +277,7 @@ public: DEFINE_HELPERS(LShr, Exact) // CreateExactLShr #undef DEFINE_HELPERS - + /// Helper functions to construct and inspect unary operations (NEG and NOT) /// via binary operators SUB and XOR: /// @@ -525,6 +525,12 @@ public: BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); + /// @brief Check whether it is valid to call getCastOpcode for these types. + static bool isCastable( + Type *SrcTy, ///< The Type from which the value should be cast. + Type *DestTy ///< The Type to which the value should be cast. + ); + /// @brief Check whether a bitcast between these types is valid static bool isBitCastable( Type *SrcTy, ///< The Type from which the value should be cast. |