From c449a224bb5f7ae223106532be60294376f06630 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 4 Jan 2011 12:52:29 +0000 Subject: [PATCH] These methods should be "const"; make them so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122809 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/InstrTypes.h | 4 ++-- lib/VMCore/Instructions.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 6715416afa1..25b63a51e69 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -824,11 +824,11 @@ public: /// This is just a convenience that dispatches to the subclasses. /// @brief Determine if this CmpInst is commutative. - bool isCommutative(); + bool isCommutative() const; /// This is just a convenience that dispatches to the subclasses. /// @brief Determine if this is an equals/not equals predicate. - bool isEquality(); + bool isEquality() const; /// @returns true if the comparison is signed, false otherwise. /// @brief Determine if this instruction is using a signed comparison. diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index efa390fe2aa..f465907735e 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -2736,14 +2736,14 @@ void CmpInst::swapOperands() { cast(this)->swapOperands(); } -bool CmpInst::isCommutative() { - if (ICmpInst *IC = dyn_cast(this)) +bool CmpInst::isCommutative() const { + if (const ICmpInst *IC = dyn_cast(this)) return IC->isCommutative(); return cast(this)->isCommutative(); } -bool CmpInst::isEquality() { - if (ICmpInst *IC = dyn_cast(this)) +bool CmpInst::isEquality() const { + if (const ICmpInst *IC = dyn_cast(this)) return IC->isEquality(); return cast(this)->isEquality(); }