f13e7d5480267bc1a9c1208244f17a1dd695fda7
[oota-llvm.git] / 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   class MCFixup;
15   class MCObjectWriter;
16   class MCValue;
17   class raw_ostream;
18
19   class MCWinCOFFObjectTargetWriter {
20     const unsigned Machine;
21
22   protected:
23     MCWinCOFFObjectTargetWriter(unsigned Machine_);
24
25   public:
26     virtual ~MCWinCOFFObjectTargetWriter() {}
27
28     unsigned getMachine() const { return Machine; }
29     virtual unsigned getRelocType(const MCValue &Target,
30                                   const MCFixup &Fixup,
31                                   bool IsCrossSection) const = 0;
32   };
33
34   /// \brief Construct a new Win COFF writer instance.
35   ///
36   /// \param MOTW - The target specific WinCOFF writer subclass.
37   /// \param OS - The stream to write to.
38   /// \returns The constructed object writer.
39   MCObjectWriter *createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW,
40                                             raw_ostream &OS);
41 } // End llvm namespace
42
43 #endif