comparison include/llvm/MC/MCWinCOFFObjectWriter.h @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents afa8332a0e37
children
comparison
equal deleted inserted replaced
120:1172e4bd9c6f 121:803732b1fca8
1 //===-- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object Writer *- C++ -*-===// 1 //===- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object Writer -*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 9
10 #ifndef LLVM_MC_MCWINCOFFOBJECTWRITER_H 10 #ifndef LLVM_MC_MCWINCOFFOBJECTWRITER_H
11 #define LLVM_MC_MCWINCOFFOBJECTWRITER_H 11 #define LLVM_MC_MCWINCOFFOBJECTWRITER_H
12 12
13 #include <memory>
14
13 namespace llvm { 15 namespace llvm {
16
14 class MCAsmBackend; 17 class MCAsmBackend;
18 class MCContext;
15 class MCFixup; 19 class MCFixup;
16 class MCObjectWriter; 20 class MCObjectWriter;
17 class MCValue; 21 class MCValue;
18 class raw_ostream;
19 class raw_pwrite_stream; 22 class raw_pwrite_stream;
20 23
21 class MCWinCOFFObjectTargetWriter { 24 class MCWinCOFFObjectTargetWriter {
22 virtual void anchor(); 25 virtual void anchor();
26
23 const unsigned Machine; 27 const unsigned Machine;
24 28
25 protected: 29 protected:
26 MCWinCOFFObjectTargetWriter(unsigned Machine_); 30 MCWinCOFFObjectTargetWriter(unsigned Machine_);
27 31
28 public: 32 public:
29 virtual ~MCWinCOFFObjectTargetWriter() {} 33 virtual ~MCWinCOFFObjectTargetWriter() = default;
30 34
31 unsigned getMachine() const { return Machine; } 35 unsigned getMachine() const { return Machine; }
32 virtual unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup, 36 virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
33 bool IsCrossSection, 37 const MCFixup &Fixup, bool IsCrossSection,
34 const MCAsmBackend &MAB) const = 0; 38 const MCAsmBackend &MAB) const = 0;
35 virtual bool recordRelocation(const MCFixup &) const { return true; } 39 virtual bool recordRelocation(const MCFixup &) const { return true; }
36 }; 40 };
37 41
38 /// \brief Construct a new Win COFF writer instance. 42 /// \brief Construct a new Win COFF writer instance.
39 /// 43 ///
40 /// \param MOTW - The target specific WinCOFF writer subclass. 44 /// \param MOTW - The target specific WinCOFF writer subclass.
41 /// \param OS - The stream to write to. 45 /// \param OS - The stream to write to.
42 /// \returns The constructed object writer. 46 /// \returns The constructed object writer.
43 MCObjectWriter *createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW, 47 std::unique_ptr<MCObjectWriter>
44 raw_pwrite_stream &OS); 48 createWinCOFFObjectWriter(std::unique_ptr<MCWinCOFFObjectTargetWriter> MOTW,
45 } // End llvm namespace 49 raw_pwrite_stream &OS);
50 } // end namespace llvm
46 51
47 #endif 52 #endif // LLVM_MC_MCWINCOFFOBJECTWRITER_H