aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZGNUInstPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/SystemZ/MCTargetDesc/SystemZGNUInstPrinter.cpp')
-rw-r--r--llvm/lib/Target/SystemZ/MCTargetDesc/SystemZGNUInstPrinter.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZGNUInstPrinter.cpp b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZGNUInstPrinter.cpp
new file mode 100644
index 000000000000..72b7bd60276a
--- /dev/null
+++ b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZGNUInstPrinter.cpp
@@ -0,0 +1,33 @@
+//===- SystemZGNUInstPrinter.cpp - Convert SystemZ MCInst to GNU assembly -===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "SystemZGNUInstPrinter.h"
+#include "llvm/MC/MCInst.h"
+#include "llvm/MC/MCRegister.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+
+#define DEBUG_TYPE "asm-printer"
+
+#include "SystemZGenGNUAsmWriter.inc"
+
+void SystemZGNUInstPrinter::printFormattedRegName(const MCAsmInfo *MAI,
+ MCRegister Reg,
+ raw_ostream &O) {
+ const char *RegName = getRegisterName(Reg);
+ markup(O, Markup::Register) << '%' << RegName;
+}
+
+void SystemZGNUInstPrinter::printInst(const MCInst *MI, uint64_t Address,
+ StringRef Annot,
+ const MCSubtargetInfo &STI,
+ raw_ostream &O) {
+ printInstruction(MI, Address, O);
+ printAnnotation(O, Annot);
+}