1 //===-- llvm/MC/MCWasmObjectWriter.h - Wasm Object Writer -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCWASMOBJECTWRITER_H
11 #define LLVM_MC_MCWASMOBJECTWRITER_H
13 #include "llvm/ADT/Triple.h"
14 #include "llvm/BinaryFormat/Wasm.h"
15 #include "llvm/Support/DataTypes.h"
22 class raw_pwrite_stream;
24 class MCWasmObjectTargetWriter {
25 const unsigned Is64Bit : 1;
28 explicit MCWasmObjectTargetWriter(bool Is64Bit_);
31 virtual ~MCWasmObjectTargetWriter();
33 virtual unsigned getRelocType(const MCValue &Target,
34 const MCFixup &Fixup) const = 0;
38 bool is64Bit() const { return Is64Bit; }
42 /// \brief Construct a new Wasm writer instance.
44 /// \param MOTW - The target specific Wasm writer subclass.
45 /// \param OS - The stream to write to.
46 /// \returns The constructed object writer.
47 std::unique_ptr<MCObjectWriter>
48 createWasmObjectWriter(std::unique_ptr<MCWasmObjectTargetWriter> MOTW,
49 raw_pwrite_stream &OS);
51 } // End llvm namespace