LLVM
7.0.0
lib
BinaryFormat
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
12
std::string
llvm::wasm::toString
(
wasm::WasmSymbolType
type
) {
13
switch
(type) {
14
case
wasm::WASM_SYMBOL_TYPE_FUNCTION
:
15
return
"WASM_SYMBOL_TYPE_FUNCTION"
;
16
case
wasm::WASM_SYMBOL_TYPE_GLOBAL
:
17
return
"WASM_SYMBOL_TYPE_GLOBAL"
;
18
case
wasm::WASM_SYMBOL_TYPE_DATA
:
19
return
"WASM_SYMBOL_TYPE_DATA"
;
20
case
wasm::WASM_SYMBOL_TYPE_SECTION
:
21
return
"WASM_SYMBOL_TYPE_SECTION"
;
22
}
23
llvm_unreachable
(
"unknown symbol type"
);
24
}
25
26
std::string
llvm::wasm::relocTypetoString
(
uint32_t
type
) {
27
switch
(type) {
28
#define WASM_RELOC(NAME, VALUE) case VALUE: return #NAME;
29
#include "llvm/BinaryFormat/WasmRelocs.def"
30
#undef WASM_RELOC
31
default
:
32
llvm_unreachable
(
"unknown reloc type"
);
33
}
34
}
llvm::wasm::WasmSymbolType
WasmSymbolType
Definition:
Wasm.h:252
llvm::wasm::WASM_SYMBOL_TYPE_FUNCTION
Definition:
Wasm.h:253
llvm::wasm::WASM_SYMBOL_TYPE_DATA
Definition:
Wasm.h:254
llvm::wasm::WASM_SYMBOL_TYPE_SECTION
Definition:
Wasm.h:256
Wasm.h
llvm::wasm::WASM_SYMBOL_TYPE_GLOBAL
Definition:
Wasm.h:255
llvm::wasm::relocTypetoString
std::string relocTypetoString(uint32_t type)
Definition:
Wasm.cpp:26
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:
ErrorHandling.h:136
uint32_t
type
llvm::wasm::toString
std::string toString(wasm::WasmSymbolType type)
Definition:
Wasm.cpp:12
Generated on Thu Aug 23 2018 18:52:54 for LLVM by
1.8.13