LLVM  5.0.0
MCWasmObjectWriter.h
Go to the documentation of this file.
1 //===-- llvm/MC/MCWasmObjectWriter.h - Wasm Object Writer -------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_MC_MCWASMOBJECTWRITER_H
11 #define LLVM_MC_MCWASMOBJECTWRITER_H
12 
13 #include "llvm/ADT/Triple.h"
14 #include "llvm/BinaryFormat/Wasm.h"
15 #include "llvm/Support/DataTypes.h"
16 
17 namespace llvm {
18 
19 class MCFixup;
20 class MCObjectWriter;
21 class MCValue;
22 class raw_pwrite_stream;
23 
25  const unsigned Is64Bit : 1;
26 
27 protected:
28  explicit MCWasmObjectTargetWriter(bool Is64Bit_);
29 
30 public:
31  virtual ~MCWasmObjectTargetWriter();
32 
33  virtual unsigned getRelocType(const MCValue &Target,
34  const MCFixup &Fixup) const = 0;
35 
36  /// \name Accessors
37  /// @{
38  bool is64Bit() const { return Is64Bit; }
39  /// @}
40 };
41 
42 /// \brief Construct a new Wasm writer instance.
43 ///
44 /// \param MOTW - The target specific Wasm writer subclass.
45 /// \param OS - The stream to write to.
46 /// \returns The constructed object writer.
47 MCObjectWriter *createWasmObjectWriter(MCWasmObjectTargetWriter *MOTW,
48  raw_pwrite_stream &OS);
49 
50 } // End llvm namespace
51 
52 #endif
MCObjectWriter * createWasmObjectWriter(MCWasmObjectTargetWriter *MOTW, raw_pwrite_stream &OS)
Construct a new Wasm writer instance.
This represents an "assembler immediate".
Definition: MCValue.h:40
virtual unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup) const =0
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:66
PowerPC TLS Dynamic Call Fixup
Target - Wrapper for Target specific information.