diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-09-18 07:27:23 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-09-18 07:27:23 +0000 |
commit | 6d63a728586d56eb3e881905beb9db27f520f5d3 (patch) | |
tree | 35dced4c3a1f7993f85d8b6c03afa40b3b1235fd /lib/Target | |
parent | 3f7eb8eba083677d38cc8c96f00a945399421aaf (diff) | |
download | llvm-6d63a728586d56eb3e881905beb9db27f520f5d3.tar.gz llvm-6d63a728586d56eb3e881905beb9db27f520f5d3.tar.bz2 llvm-6d63a728586d56eb3e881905beb9db27f520f5d3.tar.xz |
Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56300 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 3e617f97b9..c2e2417284 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -44,7 +44,7 @@ STATISTIC(EmittedInsts, "Number of machine instrs printed"); namespace { struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter { ARMAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T) - : AsmPrinter(O, TM, T), DW(O, this, T), MMI(NULL), AFI(NULL), + : AsmPrinter(O, TM, T), DW(O, this, T), MMI(NULL), AFI(NULL), MCP(NULL), InCPMode(false) { Subtarget = &TM.getSubtarget<ARMSubtarget>(); } @@ -57,9 +57,13 @@ namespace { const ARMSubtarget *Subtarget; /// AFI - Keep a pointer to ARMFunctionInfo for the current - /// MachineFunction + /// MachineFunction. ARMFunctionInfo *AFI; + /// MCP - Keep a pointer to constantpool entries of the current + /// MachineFunction. + const MachineConstantPool *MCP; + /// We name each basic block in a Function with a unique number, so /// that we can consistently refer to them later. This is cleared /// at the beginning of each call to runOnMachineFunction(). @@ -185,6 +189,7 @@ std::string ARMAsmPrinter::getSectionForFunction(const Function &F) const { /// bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { AFI = MF.getInfo<ARMFunctionInfo>(); + MCP = MF.getConstantPool(); SetupMachineFunction(MF); O << "\n"; @@ -670,8 +675,7 @@ void ARMAsmPrinter::printCPInstOperand(const MachineInstr *MI, int OpNo, assert(!strcmp(Modifier, "cpentry") && "Unknown modifier for CPE"); unsigned CPI = MI->getOperand(OpNo).getIndex(); - const MachineConstantPoolEntry &MCPE = // Chasing pointers is fun? - MI->getParent()->getParent()->getConstantPool()->getConstants()[CPI]; + const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPI]; if (MCPE.isMachineConstantPoolEntry()) { EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal); |