Constify arguments in isSuccessor and isLayoutSuccessor.
authorDan Gohman <gohman@apple.com>
Mon, 30 Mar 2009 20:06:29 +0000 (20:06 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 30 Mar 2009 20:06:29 +0000 (20:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68054 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 56b96ea872aa4f61dbdb3852956c92075194d07f..1ba7e798f832d602f5686a2f8b08ce6322fa3198 100644 (file)
@@ -239,14 +239,14 @@ public:
   
   /// isSuccessor - Return true if the specified MBB is a successor of this
   /// block.
-  bool isSuccessor(MachineBasicBlock *MBB) const;
+  bool isSuccessor(const MachineBasicBlock *MBB) const;
 
   /// isLayoutSuccessor - Return true if the specified MBB will be emitted
   /// immediately after this block, such that if this block exits by
   /// falling through, control will transfer to the specified MBB. Note
   /// that MBB need not be a successor at all, for example if this block
   /// ends with an unconditional branch to some other block.
-  bool isLayoutSuccessor(MachineBasicBlock *MBB) const;
+  bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
 
   /// getFirstTerminator - returns an iterator to the first terminator
   /// instruction of this basic block. If a terminator does not exist,
index 1d68d7cd2b9dc541e2ad294da7d323c715f6f6a8..51f0f9d0001f02ff0b727041e826edd7a9ea20b3 100644 (file)
@@ -248,13 +248,13 @@ void MachineBasicBlock::transferSuccessors(MachineBasicBlock *fromMBB)
     fromMBB->removeSuccessor(fromMBB->succ_begin());
 }
 
-bool MachineBasicBlock::isSuccessor(MachineBasicBlock *MBB) const {
+bool MachineBasicBlock::isSuccessor(const MachineBasicBlock *MBB) const {
   std::vector<MachineBasicBlock *>::const_iterator I =
     std::find(Successors.begin(), Successors.end(), MBB);
   return I != Successors.end();
 }
 
-bool MachineBasicBlock::isLayoutSuccessor(MachineBasicBlock *MBB) const {
+bool MachineBasicBlock::isLayoutSuccessor(const MachineBasicBlock *MBB) const {
   MachineFunction::const_iterator I(this);
   return next(I) == MachineFunction::const_iterator(MBB);
 }