LLVM  8.0.1
Wasm.cpp
Go to the documentation of this file.
1 //===-- llvm/BinaryFormat/Wasm.cpp -------------------------------*- 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 #include "llvm/BinaryFormat/Wasm.h"
11 
13  switch (type) {
15  return "WASM_SYMBOL_TYPE_FUNCTION";
17  return "WASM_SYMBOL_TYPE_GLOBAL";
19  return "WASM_SYMBOL_TYPE_DATA";
21  return "WASM_SYMBOL_TYPE_SECTION";
23  return "WASM_SYMBOL_TYPE_EVENT";
24  }
25  llvm_unreachable("unknown symbol type");
26 }
27 
29  switch (type) {
30 #define WASM_RELOC(NAME, VALUE) \
31  case VALUE: \
32  return #NAME;
33 #include "llvm/BinaryFormat/WasmRelocs.def"
34 #undef WASM_RELOC
35  default:
36  llvm_unreachable("unknown reloc type");
37  }
38 }
WasmSymbolType
Definition: Wasm.h:266
std::string relocTypetoString(uint32_t type)
Definition: Wasm.cpp:28
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::string toString(wasm::WasmSymbolType type)
Definition: Wasm.cpp:12