Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  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. #ifndef LLVM_MC_MCCODEEMITTER_H
  10. #define LLVM_MC_MCCODEEMITTER_H
  11. #include "llvm/Support/Compiler.h"
  12. namespace llvm {
  13. class MCFixup;
  14. class MCInst;
  15. class raw_ostream;
  16. template<typename T> class SmallVectorImpl;
  17. /// MCCodeEmitter - Generic instruction encoding interface.
  18. class MCCodeEmitter {
  19. private:
  20. MCCodeEmitter(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
  21. void operator=(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
  22. protected: // Can only create subclasses.
  23. MCCodeEmitter();
  24. public:
  25. virtual ~MCCodeEmitter();
  26. /// Lifetime management
  27. virtual void reset() { }
  28. /// EncodeInstruction - Encode the given \p Inst to bytes on the output
  29. /// stream \p OS.
  30. virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
  31. SmallVectorImpl<MCFixup> &Fixups) const = 0;
  32. };
  33. } // End llvm namespace
  34. #endif