From: Dan Gohman Date: Tue, 18 Nov 2008 19:04:29 +0000 (+0000) Subject: Make some methods const. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b3b930a011554fc7566dd4311af3862b01e5fd8f;p=oota-llvm.git Make some methods const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59540 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 8efea624425..0cdad848b9a 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -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 diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 81fe48e7a67..dfa4629df62 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -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) ||