LLVM API Documentation
00001 //===-- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object Writer *- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_MC_MCWINCOFFOBJECTWRITER_H 00011 #define LLVM_MC_MCWINCOFFOBJECTWRITER_H 00012 00013 namespace llvm { 00014 class MCFixup; 00015 class MCObjectWriter; 00016 class MCValue; 00017 class raw_ostream; 00018 00019 class MCWinCOFFObjectTargetWriter { 00020 virtual void anchor(); 00021 const unsigned Machine; 00022 00023 protected: 00024 MCWinCOFFObjectTargetWriter(unsigned Machine_); 00025 00026 public: 00027 virtual ~MCWinCOFFObjectTargetWriter() {} 00028 00029 unsigned getMachine() const { return Machine; } 00030 virtual unsigned getRelocType(const MCValue &Target, 00031 const MCFixup &Fixup, 00032 bool IsCrossSection) const = 0; 00033 virtual bool recordRelocation(const MCFixup &) const { return true; } 00034 }; 00035 00036 /// \brief Construct a new Win COFF writer instance. 00037 /// 00038 /// \param MOTW - The target specific WinCOFF writer subclass. 00039 /// \param OS - The stream to write to. 00040 /// \returns The constructed object writer. 00041 MCObjectWriter *createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW, 00042 raw_ostream &OS); 00043 } // End llvm namespace 00044 00045 #endif