1 //===- llvm/MC/MCDXContainerWriter.h - DXContainer 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_MCDXCONTAINERWRITER_H 10 #define LLVM_MC_MCDXCONTAINERWRITER_H 11 12 #include "llvm/MC/MCObjectWriter.h" 13 #include "llvm/TargetParser/Triple.h" 14 15 namespace llvm { 16 17 class raw_pwrite_stream; 18 19 class MCDXContainerTargetWriter : public MCObjectTargetWriter { 20 protected: MCDXContainerTargetWriter()21 MCDXContainerTargetWriter() {} 22 23 public: 24 virtual ~MCDXContainerTargetWriter(); 25 getFormat()26 Triple::ObjectFormatType getFormat() const override { 27 return Triple::DXContainer; 28 } classof(const MCObjectTargetWriter * W)29 static bool classof(const MCObjectTargetWriter *W) { 30 return W->getFormat() == Triple::DXContainer; 31 } 32 }; 33 34 /// Construct a new DXContainer writer instance. 35 /// 36 /// \param MOTW - The target specific DXContainer writer subclass. 37 /// \param OS - The stream to write to. 38 /// \returns The constructed object writer. 39 std::unique_ptr<MCObjectWriter> 40 createDXContainerObjectWriter(std::unique_ptr<MCDXContainerTargetWriter> MOTW, 41 raw_pwrite_stream &OS); 42 43 } // end namespace llvm 44 45 #endif // LLVM_MC_MCDXCONTAINERWRITER_H 46