summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
index 46ccd2129969..defab665f924 100644
--- a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
@@ -24,7 +24,7 @@
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
-#include "llvm/Support/TargetRegistry.h"
+#include "llvm/MC/TargetRegistry.h"
using namespace llvm;
@@ -549,15 +549,17 @@ void SystemZAsmPrinter::emitInstruction(const MachineInstr *MI) {
Register SrcReg = MI->getOperand(4).getReg();
int64_t SrcDisp = MI->getOperand(5).getImm();
+ SystemZTargetStreamer *TS = getTargetStreamer();
MCSymbol *DotSym = nullptr;
MCInst ET = MCInstBuilder(TargetInsOpc).addReg(DestReg)
.addImm(DestDisp).addImm(1).addReg(SrcReg).addImm(SrcDisp);
- MCInstSTIPair ET_STI(ET, &MF->getSubtarget());
- EXRLT2SymMap::iterator I = EXRLTargets2Sym.find(ET_STI);
- if (I != EXRLTargets2Sym.end())
+ SystemZTargetStreamer::MCInstSTIPair ET_STI(ET, &MF->getSubtarget());
+ SystemZTargetStreamer::EXRLT2SymMap::iterator I =
+ TS->EXRLTargets2Sym.find(ET_STI);
+ if (I != TS->EXRLTargets2Sym.end())
DotSym = I->second;
else
- EXRLTargets2Sym[ET_STI] = DotSym = OutContext.createTempSymbol();
+ TS->EXRLTargets2Sym[ET_STI] = DotSym = OutContext.createTempSymbol();
const MCSymbolRefExpr *Dot = MCSymbolRefExpr::create(DotSym, OutContext);
EmitToStreamer(
*OutStreamer,
@@ -722,19 +724,6 @@ void SystemZAsmPrinter::LowerPATCHPOINT(const MachineInstr &MI,
getSubtargetInfo());
}
-void SystemZAsmPrinter::emitEXRLTargetInstructions() {
- if (EXRLTargets2Sym.empty())
- return;
- // Switch to the .text section.
- OutStreamer->SwitchSection(getObjFileLowering().getTextSection());
- for (auto &I : EXRLTargets2Sym) {
- OutStreamer->emitLabel(I.second);
- const MCInstSTIPair &MCI_STI = I.first;
- OutStreamer->emitInstruction(MCI_STI.first, *MCI_STI.second);
- }
- EXRLTargets2Sym.clear();
-}
-
// Convert a SystemZ-specific constant pool modifier into the associated
// MCSymbolRefExpr variant kind.
static MCSymbolRefExpr::VariantKind
@@ -786,14 +775,14 @@ bool SystemZAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
unsigned OpNo,
const char *ExtraCode,
raw_ostream &OS) {
- SystemZInstPrinter::printAddress(MAI, MI->getOperand(OpNo).getReg(),
- MI->getOperand(OpNo + 1).getImm(),
- MI->getOperand(OpNo + 2).getReg(), OS);
+ SystemZInstPrinter::
+ printAddress(MAI, MI->getOperand(OpNo).getReg(),
+ MCOperand::createImm(MI->getOperand(OpNo + 1).getImm()),
+ MI->getOperand(OpNo + 2).getReg(), OS);
return false;
}
void SystemZAsmPrinter::emitEndOfAsmFile(Module &M) {
- emitEXRLTargetInstructions();
emitStackMaps(SM);
}