diff options
author | Chris Lattner <sabre@nondot.org> | 2003-07-26 23:29:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-07-26 23:29:51 +0000 |
commit | 8d3f8e226d6cac7882e9ffe7482602a7521400c3 (patch) | |
tree | 166d00aff90702e0a627370af088c951888c2e12 /lib/CodeGen/InstrSelection/InstrSelection.cpp | |
parent | 9e2dd8f8d7c995721584d8c7add309e5d9cb1051 (diff) |
Making this code const-correct would be a pain, so I'll hack it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InstrSelection/InstrSelection.cpp')
-rw-r--r-- | lib/CodeGen/InstrSelection/InstrSelection.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp index e4dd2e9dac..a666c5fe2e 100644 --- a/lib/CodeGen/InstrSelection/InstrSelection.cpp +++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp @@ -189,8 +189,8 @@ InstructionSelection::InsertCodeForPhis(Function &F) // MachineFunction &MF = MachineFunction::get(&F); for (MachineFunction::iterator BB = MF.begin(); BB != MF.end(); ++BB) { - for (BasicBlock::iterator IIt = BB->getBasicBlock()->begin(); - PHINode *PN = dyn_cast<PHINode>(IIt); ++IIt) { + for (BasicBlock::const_iterator IIt = BB->getBasicBlock()->begin(); + const PHINode *PN = dyn_cast<PHINode>(IIt); ++IIt) { // FIXME: This is probably wrong... Value *PhiCpRes = new PHINode(PN->getType(), "PhiCp:"); @@ -209,7 +209,7 @@ InstructionSelection::InsertCodeForPhis(Function &F) for (vector<MachineInstr*>::iterator MI=mvec.begin(); MI != mvec.end(); ++MI) { vector<MachineInstr*> CpVec2 = - FixConstantOperandsForInstr(PN, *MI, Target); + FixConstantOperandsForInstr(const_cast<PHINode*>(PN), *MI, Target); CpVec2.push_back(*MI); CpVec.insert(CpVec.end(), CpVec2.begin(), CpVec2.end()); } @@ -218,7 +218,8 @@ InstructionSelection::InsertCodeForPhis(Function &F) } vector<MachineInstr*> mvec; - Target.getRegInfo().cpValue2Value(PhiCpRes, PN, mvec); + Target.getRegInfo().cpValue2Value(PhiCpRes, const_cast<PHINode*>(PN), + mvec); BB->insert(BB->begin(), mvec.begin(), mvec.end()); } // for each Phi Instr in BB } // for all BBs in function |