From 36fe028a2a8e58662af11f6a741d03bc551e4cc8 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 3 Feb 2015 07:22:52 +0000 Subject: Only access TLOF via the TargetMachine, not TargetLowering. llvm-svn: 227949 --- llvm/lib/Target/Mips/MipsISelLowering.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'llvm/lib/Target/Mips/MipsISelLowering.cpp') diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 4b0099fdc4e..8e00792eb9b 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -1598,10 +1598,10 @@ SDValue MipsTargetLowering::lowerGlobalAddress(SDValue Op, const GlobalValue *GV = N->getGlobal(); if (getTargetMachine().getRelocationModel() != Reloc::PIC_ && !ABI.IsN64()) { - const MipsTargetObjectFile &TLOF = - (const MipsTargetObjectFile &)getObjFileLowering(); - - if (TLOF.IsGlobalInSmallSection(GV, getTargetMachine())) + const MipsTargetObjectFile *TLOF = + static_cast( + getTargetMachine().getObjFileLowering()); + if (TLOF->IsGlobalInSmallSection(GV, getTargetMachine())) // %gp_rel relocation return getAddrGPRel(N, SDLoc(N), Ty, DAG); @@ -1732,10 +1732,11 @@ lowerConstantPool(SDValue Op, SelectionDAG &DAG) const EVT Ty = Op.getValueType(); if (getTargetMachine().getRelocationModel() != Reloc::PIC_ && !ABI.IsN64()) { - const MipsTargetObjectFile &TLOF = - (const MipsTargetObjectFile &)getObjFileLowering(); + const MipsTargetObjectFile *TLOF = + static_cast( + getTargetMachine().getObjFileLowering()); - if (TLOF.IsConstantInSmallSection(N->getConstVal(), getTargetMachine())) + if (TLOF->IsConstantInSmallSection(N->getConstVal(), getTargetMachine())) // %gp_rel relocation return getAddrGPRel(N, SDLoc(N), Ty, DAG); -- cgit v1.2.3