[ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.
[llvm-core.git] / include / llvm / MC / MCWasmObjectWriter.h
blobfbb68549b503748f6ccbc769726a2960a4782a76
1 //===-- llvm/MC/MCWasmObjectWriter.h - Wasm 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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_MC_MCWASMOBJECTWRITER_H
10 #define LLVM_MC_MCWASMOBJECTWRITER_H
12 #include "llvm/MC/MCObjectWriter.h"
13 #include <memory>
15 namespace llvm {
17 class MCFixup;
18 class MCValue;
19 class raw_pwrite_stream;
21 class MCWasmObjectTargetWriter : public MCObjectTargetWriter {
22 const unsigned Is64Bit : 1;
23 const unsigned IsEmscripten : 1;
25 protected:
26 explicit MCWasmObjectTargetWriter(bool Is64Bit_, bool IsEmscripten);
28 public:
29 virtual ~MCWasmObjectTargetWriter();
31 virtual Triple::ObjectFormatType getFormat() const { return Triple::Wasm; }
32 static bool classof(const MCObjectTargetWriter *W) {
33 return W->getFormat() == Triple::Wasm;
36 virtual unsigned getRelocType(const MCValue &Target,
37 const MCFixup &Fixup) const = 0;
39 /// \name Accessors
40 /// @{
41 bool is64Bit() const { return Is64Bit; }
42 bool isEmscripten() const { return IsEmscripten; }
43 /// @}
46 /// Construct a new Wasm writer instance.
47 ///
48 /// \param MOTW - The target specific Wasm writer subclass.
49 /// \param OS - The stream to write to.
50 /// \returns The constructed object writer.
51 std::unique_ptr<MCObjectWriter>
52 createWasmObjectWriter(std::unique_ptr<MCWasmObjectTargetWriter> MOTW,
53 raw_pwrite_stream &OS);
55 } // namespace llvm
57 #endif