[PATCH] D126553: [WebAssembly] Consolidate sectionTypeToString in BinaryFormat [NFC]
Derek Schuff via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 27 09:10:14 PDT 2022
dschuff added inline comments.
================
Comment at: llvm/include/llvm/BinaryFormat/Wasm.h:475
std::string relocTypetoString(uint32_t type);
+llvm::StringRef sectionTypeToString(uint32_t type);
bool relocTypeHasAddend(uint32_t type);
----------------
dschuff wrote:
> sbc100 wrote:
> > Use `std::string` for consistency with the two above? Or convert them all the StringRef?
> I had originally planned that for after D126509 but I guess since this is now just a pure refactor, we can add it in. As I said there, IMO `StringRef` would be better since the backing store is just a static const char* and then we wouldn't need to copy. But I'll check whether any of the uses of `relocTypeToString` and `toString` really do need to be `std::string`.
OK, they're all stringref now, no callsite changes were needed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126553/new/
https://reviews.llvm.org/D126553
More information about the llvm-commits
mailing list