zig/deps/lld/wasm/WriterUtils.h

67 lines
2.2 KiB
C
Raw Normal View History

2018-01-18 06:29:21 +08:00
//===- WriterUtils.h --------------------------------------------*- C++ -*-===//
//
2019-08-04 00:43:55 +08:00
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2018-01-18 06:29:21 +08:00
//
//===----------------------------------------------------------------------===//
#ifndef LLD_WASM_WRITERUTILS_H
#define LLD_WASM_WRITERUTILS_H
2018-08-05 05:47:16 +08:00
#include "lld/Common/LLVM.h"
2018-01-18 06:29:21 +08:00
#include "llvm/ADT/Twine.h"
#include "llvm/Object/Wasm.h"
namespace lld {
namespace wasm {
2019-08-04 00:43:55 +08:00
void debugWrite(uint64_t offset, const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeUleb128(raw_ostream &os, uint32_t number, const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeSleb128(raw_ostream &os, int32_t number, const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeBytes(raw_ostream &os, const char *bytes, size_t count,
const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeStr(raw_ostream &os, StringRef string, const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeU8(raw_ostream &os, uint8_t byte, const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeU32(raw_ostream &os, uint32_t number, const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeValueType(raw_ostream &os, llvm::wasm::ValType type,
const Twine &msg);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeSig(raw_ostream &os, const llvm::wasm::WasmSignature &sig);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeInitExpr(raw_ostream &os, const llvm::wasm::WasmInitExpr &initExpr);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeLimits(raw_ostream &os, const llvm::wasm::WasmLimits &limits);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeGlobalType(raw_ostream &os, const llvm::wasm::WasmGlobalType &type);
2018-08-05 05:47:16 +08:00
2019-08-04 00:43:55 +08:00
void writeGlobal(raw_ostream &os, const llvm::wasm::WasmGlobal &global);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeEventType(raw_ostream &os, const llvm::wasm::WasmEventType &type);
2019-02-08 06:07:18 +08:00
2019-08-04 00:43:55 +08:00
void writeEvent(raw_ostream &os, const llvm::wasm::WasmEvent &event);
2019-02-08 06:07:18 +08:00
2019-08-04 00:43:55 +08:00
void writeTableType(raw_ostream &os, const llvm::wasm::WasmTable &type);
2018-08-05 05:47:16 +08:00
2019-08-04 00:43:55 +08:00
void writeImport(raw_ostream &os, const llvm::wasm::WasmImport &import);
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
void writeExport(raw_ostream &os, const llvm::wasm::WasmExport &export_);
2018-01-18 06:29:21 +08:00
} // namespace wasm
2019-08-04 00:43:55 +08:00
std::string toString(llvm::wasm::ValType type);
std::string toString(const llvm::wasm::WasmSignature &sig);
std::string toString(const llvm::wasm::WasmGlobalType &type);
std::string toString(const llvm::wasm::WasmEventType &type);
2018-01-18 06:29:21 +08:00
} // namespace lld
#endif // LLD_WASM_WRITERUTILS_H