[PATCH] D99399: [elfabi] Prepare llvm-elfabi for elfabi/ifs merging.

Haowei Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 17:29:37 PDT 2021


haowei added inline comments.


================
Comment at: llvm/lib/InterfaceStub/ELFStub.cpp:58
+Expected<ELFArch> llvm::elfabi::convertArchNameToEMachine(StringRef Arch) {
+  static StringMap<uint16_t> ArchNameMap = {
+      {"none", ELF::EM_NONE},
----------------
phosek wrote:
> `StringSwitch` should be more efficient than `StringMap`. It may be better to move this to `llvm/lib/BinaryFormat/ELF.cpp` and expose it as a helper function through `llvm/include/llvm/BinaryFormat/ELF.h`.

> StringSwitch should be more efficient than StringMap. 

Is that because the map is relatively small, nor worth hashing it?




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99399/new/

https://reviews.llvm.org/D99399



More information about the llvm-commits mailing list