[llvm] r370428 - [PowerPC][NFC] Use inline Subtarget->isPPC64()
Jinsong Ji via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 20:16:41 PDT 2019
Author: jsji
Date: Thu Aug 29 20:16:41 2019
New Revision: 370428
URL: http://llvm.org/viewvc/llvm-project?rev=370428&view=rev
Log:
[PowerPC][NFC] Use inline Subtarget->isPPC64()
To be consistent with all the other instances.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=370428&r1=370427&r2=370428&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Thu Aug 29 20:16:41 2019
@@ -511,7 +511,6 @@ void PPCAsmPrinter::EmitTlsCall(const Ma
///
void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
MCInst TmpInst;
- bool isPPC64 = Subtarget->isPPC64();
bool isDarwin = TM.getTargetTriple().isOSDarwin();
const Module *M = MF->getFunction().getParent();
PICLevel::Level PL = M->getPICLevel();
@@ -865,15 +864,15 @@ void PPCAsmPrinter::EmitInstruction(cons
LowerPPCMachineInstrToMCInst(MI, TmpInst, *this, isDarwin);
// Change the opcode to LD.
- TmpInst.setOpcode(isPPC64 ? PPC::LD : PPC::LWZ);
+ TmpInst.setOpcode(Subtarget->isPPC64() ? PPC::LD : PPC::LWZ);
const MachineOperand &MO = MI->getOperand(1);
const GlobalValue *GValue = MO.getGlobal();
MCSymbol *MOSymbol = getSymbol(GValue);
- const MCExpr *Exp =
- MCSymbolRefExpr::create(MOSymbol,
- isPPC64 ? MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO
- : MCSymbolRefExpr::VK_PPC_GOT_TPREL,
- OutContext);
+ const MCExpr *Exp = MCSymbolRefExpr::create(
+ MOSymbol,
+ Subtarget->isPPC64() ? MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO
+ : MCSymbolRefExpr::VK_PPC_GOT_TPREL,
+ OutContext);
TmpInst.getOperand(1) = MCOperand::createExpr(Exp);
EmitToStreamer(*OutStreamer, TmpInst);
return;
More information about the llvm-commits
mailing list