LLVM: lib/BinaryFormat/Wasm.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

12 switch (Type) {

14 return "WASM_SYMBOL_TYPE_FUNCTION";

16 return "WASM_SYMBOL_TYPE_GLOBAL";

18 return "WASM_SYMBOL_TYPE_TABLE";

20 return "WASM_SYMBOL_TYPE_DATA";

22 return "WASM_SYMBOL_TYPE_SECTION";

24 return "WASM_SYMBOL_TYPE_TAG";

25 }

27}

28

30 switch (Type) {

31#define WASM_RELOC(NAME, VALUE) \

32 case VALUE: \

33 return #NAME;

34#include "llvm/BinaryFormat/WasmRelocs.def"

35#undef WASM_RELOC

36 default:

38 }

39}

40

42#define ECase(X) \

43 case wasm::WASM_SEC_##X: \

44 return #X;

45 switch (Type) {

60 default:

62 }

63#undef ECase

64}

65

67 switch (Type) {

68 case R_WASM_MEMORY_ADDR_LEB:

69 case R_WASM_MEMORY_ADDR_LEB64:

70 case R_WASM_MEMORY_ADDR_SLEB:

71 case R_WASM_MEMORY_ADDR_SLEB64:

72 case R_WASM_MEMORY_ADDR_REL_SLEB:

73 case R_WASM_MEMORY_ADDR_REL_SLEB64:

74 case R_WASM_MEMORY_ADDR_I32:

75 case R_WASM_MEMORY_ADDR_I64:

76 case R_WASM_MEMORY_ADDR_TLS_SLEB:

77 case R_WASM_MEMORY_ADDR_TLS_SLEB64:

78 case R_WASM_FUNCTION_OFFSET_I32:

79 case R_WASM_FUNCTION_OFFSET_I64:

80 case R_WASM_SECTION_OFFSET_I32:

81 case R_WASM_MEMORY_ADDR_LOCREL_I32:

82 return true;

83 default:

84 return false;

85 }

86}

static constexpr auto TAG

StringRef - Represent a constant reference to a string, i.e.

The instances of the Type class are immutable: once they are created, they are never changed.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

LLVM_ABI llvm::StringRef toString(WasmSymbolType type)

Definition Wasm.cpp:11

@ WASM_SYMBOL_TYPE_GLOBAL

@ WASM_SYMBOL_TYPE_SECTION

@ WASM_SYMBOL_TYPE_FUNCTION

LLVM_ABI bool relocTypeHasAddend(uint32_t type)

Definition Wasm.cpp:66

LLVM_ABI llvm::StringRef sectionTypeToString(uint32_t type)

Definition Wasm.cpp:41

LLVM_ABI llvm::StringRef relocTypetoString(uint32_t type)

Definition Wasm.cpp:29