1 //===- MCGOFFObjectWriter.h - GOFF Object Writer ----------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_MC_MCGOFFOBJECTWRITER_H 10 #define LLVM_MC_MCGOFFOBJECTWRITER_H 11 12 #include "llvm/MC/MCObjectWriter.h" 13 14 namespace llvm { 15 class MCObjectWriter; 16 class raw_pwrite_stream; 17 18 class MCGOFFObjectTargetWriter : public MCObjectTargetWriter { 19 protected: 20 MCGOFFObjectTargetWriter() = default; 21 22 public: 23 virtual ~MCGOFFObjectTargetWriter() = default; 24 getFormat()25 Triple::ObjectFormatType getFormat() const override { return Triple::GOFF; } 26 classof(const MCObjectTargetWriter * W)27 static bool classof(const MCObjectTargetWriter *W) { 28 return W->getFormat() == Triple::GOFF; 29 } 30 }; 31 32 /// \brief Construct a new GOFF writer instance. 33 /// 34 /// \param MOTW - The target-specific GOFF writer subclass. 35 /// \param OS - The stream to write to. 36 /// \returns The constructed object writer. 37 std::unique_ptr<MCObjectWriter> 38 createGOFFObjectWriter(std::unique_ptr<MCGOFFObjectTargetWriter> MOTW, 39 raw_pwrite_stream &OS); 40 } // namespace llvm 41 42 #endif 43