These methods should be "const"; make them so.
authorDuncan Sands <baldrick@free.fr>
Tue, 4 Jan 2011 12:52:29 +0000 (12:52 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 4 Jan 2011 12:52:29 +0000 (12:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122809 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/InstrTypes.h
lib/VMCore/Instructions.cpp

index 6715416afa1cd59656117a9cf836e51ce8defe3c..25b63a51e69245a31cd454c0591edc5c2e0f8afd 100644 (file)
@@ -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.
index efa390fe2aa75e33533537c17f937e9581c5bb54..f465907735ea139205d14e9288fa934e79f58122 100644 (file)
@@ -2736,14 +2736,14 @@ void CmpInst::swapOperands() {
     cast<FCmpInst>(this)->swapOperands();
 }
 
-bool CmpInst::isCommutative() {
-  if (ICmpInst *IC = dyn_cast<ICmpInst>(this))
+bool CmpInst::isCommutative() const {
+  if (const ICmpInst *IC = dyn_cast<ICmpInst>(this))
     return IC->isCommutative();
   return cast<FCmpInst>(this)->isCommutative();
 }
 
-bool CmpInst::isEquality() {
-  if (ICmpInst *IC = dyn_cast<ICmpInst>(this))
+bool CmpInst::isEquality() const {
+  if (const ICmpInst *IC = dyn_cast<ICmpInst>(this))
     return IC->isEquality();
   return cast<FCmpInst>(this)->isEquality();
 }