LLVM 24.0.0git
PISAInstPrinter.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file implements the PISA MCInst printer.
11///
12//===----------------------------------------------------------------------===//
13
14#include "PISAInstPrinter.h"
15#include "llvm/MC/MCInst.h"
17
18using namespace llvm;
19
20#include "PISAGenAsmWriter.inc"
21
25
27 StringRef Annot, const MCSubtargetInfo &STI,
28 raw_ostream &OS) {
30 printAnnotation(OS, Annot);
31}
32
33void PISAInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
34 raw_ostream &O) {
35 const MCOperand &Op = MI->getOperand(OpNo);
36 if (Op.isReg())
37 printRegName(O, Op.getReg());
38 else if (Op.isImm())
39 O << Op.getImm();
40}
IRTranslator LLVM IR MI
This file declares the PISA MCInst printer.
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:187
Instances of this class represent operands of the MCInst class.
Definition MCInst.h:39
Wrapper class representing physical registers and target specific virtual registers.
Definition MCRegister.h:42
Generic base class for all target subtargets.
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
static const char * getRegisterName(MCRegister Reg)
void printRegName(raw_ostream &OS, MCRegister Reg) override
Print the assembler register name.
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS) override
Print the specified MCInst to the specified raw_ostream.
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op