Make some methods const.
authorDan Gohman <gohman@apple.com>
Tue, 18 Nov 2008 19:04:29 +0000 (19:04 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 18 Nov 2008 19:04:29 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59540 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/MachineInstr.cpp

index 8efea6244258e3207e47cd326892155196caa852..0cdad848b9ac13a39511ae7934790d5d235c9436 100644 (file)
@@ -248,11 +248,11 @@ public:
   /// isSafeToMove - Return true if it is safe to move this instruction. If
   /// SawStore is set to true, it means that there is a store (or call) between
   /// the instruction's location and its intended destination.
-  bool isSafeToMove(const TargetInstrInfo *TII, bool &SawStore);
+  bool isSafeToMove(const TargetInstrInfo *TII, bool &SawStore) const;
 
   /// isSafeToReMat - Return true if it's safe to rematerialize the specified
   /// instruction which defined the specified register instead of copying it.
-  bool isSafeToReMat(const TargetInstrInfo *TII, unsigned DstReg);
+  bool isSafeToReMat(const TargetInstrInfo *TII, unsigned DstReg) const;
 
   /// hasVolatileMemoryRef - Return true if this instruction may have a
   /// volatile memory reference, or if the information describing the
index 81fe48e7a675d9e3ec0f7e529329da371b4fdc35..dfa4629df6229df14a30915dec287f582e8554ee 100644 (file)
@@ -695,7 +695,8 @@ void MachineInstr::copyPredicates(const MachineInstr *MI) {
 /// isSafeToMove - Return true if it is safe to move this instruction. If
 /// SawStore is set to true, it means that there is a store (or call) between
 /// the instruction's location and its intended destination.
-bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII, bool &SawStore) {
+bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII,
+                                bool &SawStore) const {
   // Ignore stuff that we obviously can't move.
   if (TID->mayStore() || TID->isCall()) {
     SawStore = true;
@@ -719,7 +720,8 @@ bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII, bool &SawStore) {
 
 /// isSafeToReMat - Return true if it's safe to rematerialize the specified
 /// instruction which defined the specified register instead of copying it.
-bool MachineInstr::isSafeToReMat(const TargetInstrInfo *TII, unsigned DstReg) {
+bool MachineInstr::isSafeToReMat(const TargetInstrInfo *TII,
+                                 unsigned DstReg) const {
   bool SawStore = false;
   if (!getDesc().isRematerializable() ||
       !TII->isTriviallyReMaterializable(this) ||