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