1 //===- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object Writer -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCWINCOFFOBJECTWRITER_H
11 #define LLVM_MC_MCWINCOFFOBJECTWRITER_H
20 class raw_pwrite_stream;
22 class MCWinCOFFObjectTargetWriter {
23 virtual void anchor();
25 const unsigned Machine;
28 MCWinCOFFObjectTargetWriter(unsigned Machine_);
31 virtual ~MCWinCOFFObjectTargetWriter() = default;
33 unsigned getMachine() const { return Machine; }
34 virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
35 const MCFixup &Fixup, bool IsCrossSection,
36 const MCAsmBackend &MAB) const = 0;
37 virtual bool recordRelocation(const MCFixup &) const { return true; }
40 /// \brief Construct a new Win COFF writer instance.
42 /// \param MOTW - The target specific WinCOFF writer subclass.
43 /// \param OS - The stream to write to.
44 /// \returns The constructed object writer.
45 MCObjectWriter *createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW,
46 raw_pwrite_stream &OS);
47 } // end namespace llvm
49 #endif // LLVM_MC_MCWINCOFFOBJECTWRITER_H