diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h --- a/llvm/include/llvm/BinaryFormat/Wasm.h +++ b/llvm/include/llvm/BinaryFormat/Wasm.h @@ -470,8 +470,8 @@ return LHS.ElemType == RHS.ElemType && LHS.Limits == RHS.Limits; } -std::string toString(WasmSymbolType type); -std::string relocTypetoString(uint32_t type); +llvm::StringRef toString(WasmSymbolType type); +llvm::StringRef relocTypetoString(uint32_t type); llvm::StringRef sectionTypeToString(uint32_t type); bool relocTypeHasAddend(uint32_t type); diff --git a/llvm/lib/BinaryFormat/Wasm.cpp b/llvm/lib/BinaryFormat/Wasm.cpp --- a/llvm/lib/BinaryFormat/Wasm.cpp +++ b/llvm/lib/BinaryFormat/Wasm.cpp @@ -8,7 +8,7 @@ #include "llvm/BinaryFormat/Wasm.h" -std::string llvm::wasm::toString(wasm::WasmSymbolType Type) { +llvm::StringRef llvm::wasm::toString(wasm::WasmSymbolType Type) { switch (Type) { case wasm::WASM_SYMBOL_TYPE_FUNCTION: return "WASM_SYMBOL_TYPE_FUNCTION"; @@ -26,7 +26,7 @@ llvm_unreachable("unknown symbol type"); } -std::string llvm::wasm::relocTypetoString(uint32_t Type) { +llvm::StringRef llvm::wasm::relocTypetoString(uint32_t Type) { switch (Type) { #define WASM_RELOC(NAME, VALUE) \ case VALUE: \