summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-07-30 22:02:14 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-07-30 22:02:14 +0000
commit485c7fd76b32a69c46782a715682ed8831b0873b (patch)
tree8af5394070afbcb779a16e1ca359651a1309349b /include
parent6aebd5facbbc80787270cc1b18bffbf6c6f655e8 (diff)
downloadllvm-485c7fd76b32a69c46782a715682ed8831b0873b.tar.gz
llvm-485c7fd76b32a69c46782a715682ed8831b0873b.tar.bz2
llvm-485c7fd76b32a69c46782a715682ed8831b0873b.tar.xz
Revert "Remove isCastable since nothing uses it now"
Apparently dragonegg uses it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/IR/InstrTypes.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/llvm/IR/InstrTypes.h b/include/llvm/IR/InstrTypes.h
index e32af766ca..e12bb03a40 100644
--- a/include/llvm/IR/InstrTypes.h
+++ b/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.