diff options
Diffstat (limited to 'include/llvm/MC/MCELFObjectWriter.h')
-rw-r--r-- | include/llvm/MC/MCELFObjectWriter.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/llvm/MC/MCELFObjectWriter.h b/include/llvm/MC/MCELFObjectWriter.h index fd8d118ccdc5..bff58fef6af9 100644 --- a/include/llvm/MC/MCELFObjectWriter.h +++ b/include/llvm/MC/MCELFObjectWriter.h @@ -12,6 +12,7 @@ #include "llvm/ADT/Triple.h" #include "llvm/BinaryFormat/ELF.h" +#include "llvm/MC/MCObjectWriter.h" #include "llvm/Support/Casting.h" #include "llvm/Support/raw_ostream.h" #include <cstdint> @@ -50,7 +51,7 @@ struct ELFRelocationEntry { void dump() const { print(errs()); } }; -class MCELFObjectTargetWriter { +class MCELFObjectTargetWriter : public MCObjectTargetWriter { const uint8_t OSABI; const uint16_t EMachine; const unsigned HasRelocationAddend : 1; @@ -63,6 +64,11 @@ protected: public: virtual ~MCELFObjectTargetWriter() = default; + virtual Triple::ObjectFormatType getFormat() const { return Triple::ELF; } + static bool classof(const MCObjectTargetWriter *W) { + return W->getFormat() == Triple::ELF; + } + static uint8_t getOSABI(Triple::OSType OSType) { switch (OSType) { case Triple::CloudABI: @@ -132,7 +138,7 @@ public: } }; -/// \brief Construct a new ELF writer instance. +/// Construct a new ELF writer instance. /// /// \param MOTW - The target specific ELF writer subclass. /// \param OS - The stream to write to. @@ -141,6 +147,11 @@ std::unique_ptr<MCObjectWriter> createELFObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW, raw_pwrite_stream &OS, bool IsLittleEndian); +std::unique_ptr<MCObjectWriter> +createELFDwoObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW, + raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS, + bool IsLittleEndian); + } // end namespace llvm #endif // LLVM_MC_MCELFOBJECTWRITER_H |