diff --git a/lib/Target/PowerPC/PPC32CodeEmitter.cpp b/lib/Target/PowerPC/PPC32CodeEmitter.cpp index 733618160ac..e46d0ea4c36 100644 --- a/lib/Target/PowerPC/PPC32CodeEmitter.cpp +++ b/lib/Target/PowerPC/PPC32CodeEmitter.cpp @@ -33,9 +33,9 @@ namespace { void *MovePCtoLROffset; // Tracks which instruction references which BasicBlock - std::vector > BBRefs; + std::vector > BBRefs; // Tracks where each BasicBlock starts - std::map BBLocations; + std::map BBLocations; /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr /// @@ -120,7 +120,7 @@ bool PPC32CodeEmitter::runOnMachineFunction(MachineFunction &MF) { } void PPC32CodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) { - BBLocations[MBB.getBasicBlock()] = MCE.getCurrentPCValue(); + BBLocations[&MBB] = MCE.getCurrentPCValue(); for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I){ MachineInstr &MI = *I; unsigned Opcode = MI.getOpcode(); @@ -223,9 +223,8 @@ int PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), Reloc, MO.getGlobal(), Offset)); } else if (MO.isMachineBasicBlock()) { - const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); - BBRefs.push_back(std::make_pair(BB, CurrPC)); + BBRefs.push_back(std::make_pair(MO.getMachineBasicBlock(), CurrPC)); } else if (MO.isConstantPoolIndex()) { unsigned index = MO.getConstantPoolIndex(); assert(MovePCtoLROffset && "MovePCtoLR not seen yet?");