diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-25 00:33:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-25 00:33:57 +0000 |
commit | b752a97ca41de789434fa792b6de01f6c04fe13e (patch) | |
tree | a816ca0597391d220f3cb77cf0a61c33398ad062 /lib/Target | |
parent | 5efb75daed48edfeb03ba62f3f0afe81b86f5d7f (diff) | |
download | external_llvm-b752a97ca41de789434fa792b6de01f6c04fe13e.zip external_llvm-b752a97ca41de789434fa792b6de01f6c04fe13e.tar.gz external_llvm-b752a97ca41de789434fa792b6de01f6c04fe13e.tar.bz2 |
There is not a 1-1 mappign between llvm blocks and PPC blocks, do not use
LLVM blocks as the keys for the branch rewriter. This fixes treeadd and
many other programs with the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/PowerPC/PPCCodeEmitter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Target/PowerPC/PPCCodeEmitter.cpp b/lib/Target/PowerPC/PPCCodeEmitter.cpp index 7336181..e46d0ea 100644 --- a/lib/Target/PowerPC/PPCCodeEmitter.cpp +++ b/lib/Target/PowerPC/PPCCodeEmitter.cpp @@ -33,9 +33,9 @@ namespace { void *MovePCtoLROffset; // Tracks which instruction references which BasicBlock - std::vector<std::pair<const BasicBlock*, unsigned*> > BBRefs; + std::vector<std::pair<MachineBasicBlock*, unsigned*> > BBRefs; // Tracks where each BasicBlock starts - std::map<const BasicBlock*, long> BBLocations; + std::map<MachineBasicBlock*, long> 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?"); |