LLVM  15.0.0git
MCSPIRVObjectWriter.h
Go to the documentation of this file.
1 //===-- llvm/MC/MCSPIRVObjectWriter.h - SPIR-V 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_MCSPIRVOBJECTWRITER_H
10 #define LLVM_MC_MCSPIRVOBJECTWRITER_H
11 
12 #include "llvm/MC/MCObjectWriter.h"
14 #include <memory>
15 
16 namespace llvm {
17 
19 protected:
21 
22 public:
23  Triple::ObjectFormatType getFormat() const override { return Triple::SPIRV; }
24  static bool classof(const MCObjectTargetWriter *W) {
25  return W->getFormat() == Triple::SPIRV;
26  }
27 };
28 
29 /// Construct a new SPIR-V writer instance.
30 ///
31 /// \param MOTW - The target specific SPIR-V writer subclass.
32 /// \param OS - The stream to write to.
33 /// \returns The constructed object writer.
34 std::unique_ptr<MCObjectWriter>
35 createSPIRVObjectWriter(std::unique_ptr<MCSPIRVObjectTargetWriter> MOTW,
36  raw_pwrite_stream &OS);
37 
38 } // namespace llvm
39 
40 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::RISCVFenceField::W
@ W
Definition: RISCVBaseInfo.h:242
llvm::createSPIRVObjectWriter
std::unique_ptr< MCObjectWriter > createSPIRVObjectWriter(std::unique_ptr< MCSPIRVObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Construct a new SPIR-V writer instance.
Definition: SPIRVObjectWriter.cpp:73
llvm::Triple::SPIRV
@ SPIRV
Definition: Triple.h:277
llvm::MCObjectTargetWriter
Base class for classes that define behaviour that is specific to both the target and the object forma...
Definition: MCObjectWriter.h:120
llvm::MCSPIRVObjectTargetWriter::getFormat
Triple::ObjectFormatType getFormat() const override
Definition: MCSPIRVObjectWriter.h:23
llvm::MCSPIRVObjectTargetWriter::classof
static bool classof(const MCObjectTargetWriter *W)
Definition: MCSPIRVObjectWriter.h:24
llvm::Triple::ObjectFormatType
ObjectFormatType
Definition: Triple.h:269
MCObjectWriter.h
llvm::MCSPIRVObjectTargetWriter::MCSPIRVObjectTargetWriter
MCSPIRVObjectTargetWriter()
Definition: MCSPIRVObjectWriter.h:20
llvm::MCSPIRVObjectTargetWriter
Definition: MCSPIRVObjectWriter.h:18
raw_ostream.h