Remove the local subtarget variable from the SystemZ asm printer

and update the two calls accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2015-02-19 01:26:28 +00:00
parent 9a6b4219e2
commit 4a48ec9281
2 changed files with 3 additions and 8 deletions

View File

@ -186,7 +186,7 @@ void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) {
#undef LOWER_HIGH
case SystemZ::Serialize:
if (Subtarget->hasFastSerialization())
if (MF->getSubtarget<SystemZSubtarget>().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<const TargetLoweringObjectFileELF &>(getObjFileLowering());

View File

@ -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<MCStreamer> Streamer)
: AsmPrinter(TM, std::move(Streamer)) {
Subtarget = &TM.getSubtarget<SystemZSubtarget>();
}
: AsmPrinter(TM, std::move(Streamer)) {}
// Override AsmPrinter.
const char *getPassName() const override {