diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-28 21:41:37 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-28 21:41:37 +0000 |
commit | 69dfb5a3b65791c1ece4b0bebbaf0e498b05b652 (patch) | |
tree | 14f54963ab45bed688b60fbbfdfc09655a96616d /include | |
parent | c319be4f362293a57b68ce94993dc8ab01f34d84 (diff) | |
download | external_llvm-69dfb5a3b65791c1ece4b0bebbaf0e498b05b652.zip external_llvm-69dfb5a3b65791c1ece4b0bebbaf0e498b05b652.tar.gz external_llvm-69dfb5a3b65791c1ece4b0bebbaf0e498b05b652.tar.bz2 |
Split the logic behind CastInst::isNoopCast into a separate static function,
as is done with most other cast opcode predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/InstrTypes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index e359329..6715416 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -625,6 +625,14 @@ public: /// platform. Generally, the result of TargetData::getIntPtrType() should be /// passed in. If that's not available, use Type::Int64Ty, which will make /// the isNoopCast call conservative. + /// @brief Determine if the described cast is a no-op cast. + static bool isNoopCast( + Instruction::CastOps Opcode, ///< Opcode of cast + const Type *SrcTy, ///< SrcTy of cast + const Type *DstTy, ///< DstTy of cast + const Type *IntPtrTy ///< Integer type corresponding to Ptr types, or null + ); + /// @brief Determine if this cast is a no-op cast. bool isNoopCast( const Type *IntPtrTy ///< Integer type corresponding to pointer |