LLVM  5.0.0
MCWinCOFFObjectWriter.h
Go to the documentation of this file.
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 
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
This represents an "assembler immediate".
Definition: MCValue.h:40
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:66
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsCrossSection, const MCAsmBackend &MAB) const =0
virtual bool recordRelocation(const MCFixup &) const
Context object for machine code objects.
Definition: MCContext.h:59
virtual ~MCWinCOFFObjectTargetWriter()=default
Target - Wrapper for Target specific information.
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:35
MCObjectWriter * createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW, raw_pwrite_stream &OS)
Construct a new Win COFF writer instance.