MCWinCOFFObjectWriter.h revision df09270ae897e7fa64a7c162de163c32ee181a03
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
13namespace llvm {
14  class MCWinCOFFObjectTargetWriter {
15    const unsigned Machine;
16
17  protected:
18    MCWinCOFFObjectTargetWriter(unsigned Machine_);
19
20  public:
21    virtual ~MCWinCOFFObjectTargetWriter() {}
22
23    unsigned getMachine() const { return Machine; }
24    virtual unsigned getRelocType(unsigned FixupKind) const = 0;
25  };
26
27  /// \brief Construct a new Win COFF writer instance.
28  ///
29  /// \param MOTW - The target specific WinCOFF writer subclass.
30  /// \param OS - The stream to write to.
31  /// \returns The constructed object writer.
32  MCObjectWriter *createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW,
33                                            raw_ostream &OS);
34} // End llvm namespace
35
36#endif
37