MCWinCOFFObjectWriter.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //===-- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object Writer *- 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_MCWINCOFFOBJECTWRITER_H
  10. #define LLVM_MC_MCWINCOFFOBJECTWRITER_H
  11. namespace llvm {
  12. class MCAsmBackend;
  13. class MCFixup;
  14. class MCObjectWriter;
  15. class MCValue;
  16. class raw_ostream;
  17. class raw_pwrite_stream;
  18. class MCWinCOFFObjectTargetWriter {
  19. virtual void anchor();
  20. const unsigned Machine;
  21. protected:
  22. MCWinCOFFObjectTargetWriter(unsigned Machine_);
  23. public:
  24. virtual ~MCWinCOFFObjectTargetWriter() {}
  25. unsigned getMachine() const { return Machine; }
  26. virtual unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
  27. bool IsCrossSection,
  28. const MCAsmBackend &MAB) const = 0;
  29. virtual bool recordRelocation(const MCFixup &) const { return true; }
  30. };
  31. /// \brief Construct a new Win COFF writer instance.
  32. ///
  33. /// \param MOTW - The target specific WinCOFF writer subclass.
  34. /// \param OS - The stream to write to.
  35. /// \returns The constructed object writer.
  36. MCObjectWriter *createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW,
  37. raw_pwrite_stream &OS);
  38. } // End llvm namespace
  39. #endif