diff --git a/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/SystemZAsmPrinter.cpp index 3eb13abfa4e..18e37e32b0a 100644 --- a/lib/Target/SystemZ/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/SystemZAsmPrinter.cpp @@ -186,7 +186,7 @@ void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) { #undef LOWER_HIGH case SystemZ::Serialize: - if (Subtarget->hasFastSerialization()) + if (MF->getSubtarget().hasFastSerialization()) LoweredMI = MCInstBuilder(SystemZ::AsmBCR) .addImm(14).addReg(SystemZ::R0D); else @@ -256,7 +256,7 @@ bool SystemZAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, } void SystemZAsmPrinter::EmitEndOfAsmFile(Module &M) { - if (Subtarget->isTargetELF()) { + if (Triple(TM.getTargetTriple()).isOSBinFormatELF()) { auto &TLOFELF = static_cast(getObjFileLowering()); diff --git a/lib/Target/SystemZ/SystemZAsmPrinter.h b/lib/Target/SystemZ/SystemZAsmPrinter.h index 673e61accf6..a4d5b782fc5 100644 --- a/lib/Target/SystemZ/SystemZAsmPrinter.h +++ b/lib/Target/SystemZ/SystemZAsmPrinter.h @@ -22,14 +22,9 @@ class Module; class raw_ostream; class LLVM_LIBRARY_VISIBILITY SystemZAsmPrinter : public AsmPrinter { -private: - const SystemZSubtarget *Subtarget; - public: SystemZAsmPrinter(TargetMachine &TM, std::unique_ptr Streamer) - : AsmPrinter(TM, std::move(Streamer)) { - Subtarget = &TM.getSubtarget(); - } + : AsmPrinter(TM, std::move(Streamer)) {} // Override AsmPrinter. const char *getPassName() const override {