2017-02-08 00:02:00 +01:00
|
|
|
//===- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object Writer -*- C++ -*-===//
|
2011-12-24 03:14:02 +01:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_MC_MCWINCOFFOBJECTWRITER_H
|
|
|
|
#define LLVM_MC_MCWINCOFFOBJECTWRITER_H
|
|
|
|
|
2017-10-10 10:30:45 +02:00
|
|
|
#include <memory>
|
|
|
|
|
2011-12-24 03:14:02 +01:00
|
|
|
namespace llvm {
|
2017-02-08 00:02:00 +01:00
|
|
|
|
2015-01-22 05:03:32 +01:00
|
|
|
class MCAsmBackend;
|
2017-06-26 23:11:29 +02:00
|
|
|
class MCContext;
|
2015-01-22 05:03:32 +01:00
|
|
|
class MCFixup;
|
|
|
|
class MCObjectWriter;
|
|
|
|
class MCValue;
|
2015-04-15 00:14:34 +02:00
|
|
|
class raw_pwrite_stream;
|
2012-12-03 17:50:05 +01:00
|
|
|
|
2011-12-24 03:14:02 +01:00
|
|
|
class MCWinCOFFObjectTargetWriter {
|
2013-11-19 01:57:56 +01:00
|
|
|
virtual void anchor();
|
2017-02-08 00:02:00 +01:00
|
|
|
|
2011-12-24 03:14:02 +01:00
|
|
|
const unsigned Machine;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
MCWinCOFFObjectTargetWriter(unsigned Machine_);
|
|
|
|
|
|
|
|
public:
|
2017-02-08 00:02:00 +01:00
|
|
|
virtual ~MCWinCOFFObjectTargetWriter() = default;
|
2011-12-24 03:14:02 +01:00
|
|
|
|
|
|
|
unsigned getMachine() const { return Machine; }
|
2017-06-23 06:07:44 +02:00
|
|
|
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
|
|
|
|
const MCFixup &Fixup, bool IsCrossSection,
|
2015-01-22 05:03:32 +01:00
|
|
|
const MCAsmBackend &MAB) const = 0;
|
2014-05-22 01:17:50 +02:00
|
|
|
virtual bool recordRelocation(const MCFixup &) const { return true; }
|
2011-12-24 03:14:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/// \brief Construct a new Win COFF writer instance.
|
|
|
|
///
|
|
|
|
/// \param MOTW - The target specific WinCOFF writer subclass.
|
|
|
|
/// \param OS - The stream to write to.
|
|
|
|
/// \returns The constructed object writer.
|
2017-10-10 18:28:07 +02:00
|
|
|
std::unique_ptr<MCObjectWriter>
|
2017-10-10 02:50:29 +02:00
|
|
|
createWinCOFFObjectWriter(std::unique_ptr<MCWinCOFFObjectTargetWriter> MOTW,
|
|
|
|
raw_pwrite_stream &OS);
|
2017-02-08 00:02:00 +01:00
|
|
|
} // end namespace llvm
|
2011-12-24 03:14:02 +01:00
|
|
|
|
2017-02-08 00:02:00 +01:00
|
|
|
#endif // LLVM_MC_MCWINCOFFOBJECTWRITER_H
|