Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:12

0001 //===- llvm/MC/MCCodeEmitter.h - Instruction Encoding -----------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_MC_MCCODEEMITTER_H
0010 #define LLVM_MC_MCCODEEMITTER_H
0011 
0012 namespace llvm {
0013 
0014 class MCFixup;
0015 class MCInst;
0016 class MCSubtargetInfo;
0017 class raw_ostream;
0018 template<typename T> class SmallVectorImpl;
0019 
0020 /// MCCodeEmitter - Generic instruction encoding interface.
0021 class MCCodeEmitter {
0022 protected: // Can only create subclasses.
0023   MCCodeEmitter();
0024 
0025 public:
0026   MCCodeEmitter(const MCCodeEmitter &) = delete;
0027   MCCodeEmitter &operator=(const MCCodeEmitter &) = delete;
0028   virtual ~MCCodeEmitter();
0029 
0030   /// Lifetime management
0031   virtual void reset() {}
0032 
0033   /// Encode the given \p Inst to bytes and append to \p CB.
0034   virtual void encodeInstruction(const MCInst &Inst, SmallVectorImpl<char> &CB,
0035                                  SmallVectorImpl<MCFixup> &Fixups,
0036                                  const MCSubtargetInfo &STI) const = 0;
0037 };
0038 
0039 } // end namespace llvm
0040 
0041 #endif // LLVM_MC_MCCODEEMITTER_H