[WebAssembly] Consolidate sectionTypeToString in BinaryFormat [NFC]
authorDerek Schuff <dschuff@chromium.org>
Fri, 27 May 2022 15:23:37 +0000 (08:23 -0700)
committerDerek Schuff <dschuff@chromium.org>
Fri, 27 May 2022 16:26:36 +0000 (09:26 -0700)
commita205f2904d0ae4e3c6ce73b6e0a0aff29e46bd96
tree2513560d9ada68c6ac736d72c33539cbbbb8177b
parent042ae89556572d045619dbc7ede1be20c644fa6d
[WebAssembly] Consolidate sectionTypeToString in BinaryFormat [NFC]

Currently there are 2 duplicate implementation, and I want to add
a use in a 3rd place. Combine them in lib/BinaryFormat so they can
be shared.

Also update toString for symbol and reloc types to use StringRef

Differential Revision: https://reviews.llvm.org/D126553
lld/wasm/OutputSections.cpp
llvm/include/llvm/BinaryFormat/Wasm.h
llvm/lib/BinaryFormat/Wasm.cpp
llvm/lib/Object/WasmObjectFile.cpp