From 414832fea6de1c13f27ac9b6a38f693495791c26 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 26 Jul 2003 23:24:56 +0000 Subject: [PATCH] Const correctness fixes llvm-svn: 7349 --- llvm/lib/CodeGen/MachineFunction.cpp | 2 +- llvm/lib/CodeGen/PHIElimination.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 83567a4f761f..85bf4b6a2727 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -126,7 +126,7 @@ void MachineFunction::print(std::ostream &OS) const { getConstantPool()->print(OS); for (const_iterator BB = begin(); BB != end(); ++BB) { - BasicBlock *LBB = BB->getBasicBlock(); + const BasicBlock *LBB = BB->getBasicBlock(); OS << "\n" << LBB->getName() << " (" << (const void*)LBB << "):\n"; for (MachineBasicBlock::const_iterator I = BB->begin(); I != BB->end();++I){ OS << "\t"; diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index e221bd74ab15..cce1c5d94a53 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -200,8 +200,8 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) { // at an appropriate point later. // bool ValueIsLive = false; - BasicBlock *BB = opBlock.getBasicBlock(); - for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); + const BasicBlock *BB = opBlock.getBasicBlock(); + for (succ_const_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E && !ValueIsLive; ++SI) { const std::pair & SuccInfo = LV->getBasicBlockInfo(*SI);