LLVM  8.0.1
MCCodeEmitter.h
Go to the documentation of this file.
1 //===- llvm/MC/MCCodeEmitter.h - Instruction Encoding -----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_MC_MCCODEEMITTER_H
11 #define LLVM_MC_MCCODEEMITTER_H
12 
13 namespace llvm {
14 
15 class MCFixup;
16 class MCInst;
17 class MCSubtargetInfo;
18 class raw_ostream;
19 template<typename T> class SmallVectorImpl;
20 
21 /// MCCodeEmitter - Generic instruction encoding interface.
23 protected: // Can only create subclasses.
24  MCCodeEmitter();
25 
26 public:
27  MCCodeEmitter(const MCCodeEmitter &) = delete;
28  MCCodeEmitter &operator=(const MCCodeEmitter &) = delete;
29  virtual ~MCCodeEmitter();
30 
31  /// Lifetime management
32  virtual void reset() {}
33 
34  /// EncodeInstruction - Encode the given \p Inst to bytes on the output
35  /// stream \p OS.
36  virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS,
38  const MCSubtargetInfo &STI) const = 0;
39 };
40 
41 } // end namespace llvm
42 
43 #endif // LLVM_MC_MCCODEEMITTER_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
MCCodeEmitter & operator=(const MCCodeEmitter &)=delete
virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:161
virtual void reset()
Lifetime management.
Definition: MCCodeEmitter.h:32
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:22
virtual ~MCCodeEmitter()
Generic base class for all target subtargets.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46