Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
MCCodeEmitter.h
Go to the documentation of this file.
1//===- llvm/MC/MCCodeEmitter.h - Instruction Encoding -----------*- C++ -*-===//
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#ifndef LLVM_MC_MCCODEEMITTER_H
10#define LLVM_MC_MCCODEEMITTER_H
11
13
14namespace llvm {
15
16class MCFixup;
17class MCInst;
18class MCSubtargetInfo;
19template<typename T> class SmallVectorImpl;
20
21/// MCCodeEmitter - Generic instruction encoding interface.
23protected: // Can only create subclasses.
25
26public:
27 MCCodeEmitter(const MCCodeEmitter &) = delete;
29 virtual ~MCCodeEmitter();
30
31 /// Lifetime management
32 virtual void reset() {}
33
34 /// Encode the given \p Inst to bytes and append to \p CB.
35 virtual void encodeInstruction(const MCInst &Inst, SmallVectorImpl<char> &CB,
37 const MCSubtargetInfo &STI) const = 0;
38
39protected:
40 // Helper function used by CodeEmitterGen for error reporting.
41 [[noreturn]] static void reportUnsupportedInst(const MCInst &Inst);
42 [[noreturn]] static void reportUnsupportedOperand(const MCInst &Inst,
43 unsigned OpNum);
44};
45
46} // end namespace llvm
47
48#endif // LLVM_MC_MCCODEEMITTER_H
#define LLVM_ABI
Definition Compiler.h:213
virtual void encodeInstruction(const MCInst &Inst, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
Encode the given Inst to bytes and append to CB.
virtual void reset()
Lifetime management.
MCCodeEmitter & operator=(const MCCodeEmitter &)=delete
static void reportUnsupportedOperand(const MCInst &Inst, unsigned OpNum)
static void reportUnsupportedInst(const MCInst &Inst)
virtual ~MCCodeEmitter()
MCCodeEmitter(const MCCodeEmitter &)=delete
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition MCFixup.h:61
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Generic base class for all target subtargets.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is an optimization pass for GlobalISel generic memory operations.