]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
MFV r316877: 7571 non-present readonly numeric ZFS props do not have default value
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / MC / MCWinCOFFObjectWriter.h
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
10 #ifndef LLVM_MC_MCWINCOFFOBJECTWRITER_H
11 #define LLVM_MC_MCWINCOFFOBJECTWRITER_H
12
13 namespace llvm {
14
15 class MCAsmBackend;
16 class MCContext;
17 class MCFixup;
18 class MCObjectWriter;
19 class MCValue;
20 class raw_pwrite_stream;
21
22   class MCWinCOFFObjectTargetWriter {
23     virtual void anchor();
24
25     const unsigned Machine;
26
27   protected:
28     MCWinCOFFObjectTargetWriter(unsigned Machine_);
29
30   public:
31     virtual ~MCWinCOFFObjectTargetWriter() = default;
32
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; }
38   };
39
40   /// \brief Construct a new Win COFF writer instance.
41   ///
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
48
49 #endif // LLVM_MC_MCWINCOFFOBJECTWRITER_H