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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 00:18:49 PDT 2021


phosek 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},
----------------
`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`.


================
Comment at: llvm/lib/InterfaceStub/ELFStub.cpp:249
+llvm::elfabi::convertEMachineToArchName(ELFArch EMachine) {
+  DenseMap<uint16_t, std::string> EMachineMap = {
+      {ELF::EM_NONE, "None"},
----------------
Ditto, I'd move this to `llvm/lib/BinaryFormat/ELF.cpp`.


================
Comment at: llvm/lib/InterfaceStub/TBEHandler.cpp:138
+      IO.setError("Not a .tbe YAML file.");
+    IO.mapRequired("TbeVersion", Stub.TbeVersion);
+    IO.mapOptional("SoName", Stub.SoName);
----------------
Would this eventually become `IFSVersion`?


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