LLVM 19.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
14#include <memory>
15
16namespace llvm {
17
19protected:
21
22public:
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.
34std::unique_ptr<MCObjectWriter>
35createSPIRVObjectWriter(std::unique_ptr<MCSPIRVObjectTargetWriter> MOTW,
36 raw_pwrite_stream &OS);
37
38} // namespace llvm
39
40#endif
raw_pwrite_stream & OS
Base class for classes that define behaviour that is specific to both the target and the object forma...
static bool classof(const MCObjectTargetWriter *W)
Triple::ObjectFormatType getFormat() const override
ObjectFormatType
Definition: Triple.h:285
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
std::unique_ptr< MCObjectWriter > createSPIRVObjectWriter(std::unique_ptr< MCSPIRVObjectTargetWriter > MOTW, raw_pwrite_stream &OS)
Construct a new SPIR-V writer instance.