[PATCH] D64674: [NFC][llvm-readobj] Refactor dynamic string table indexing into a function.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 00:51:50 PDT 2019


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/elf-dynamic-malformed.test:172
+# BAD-STRTAB-LLVM: LoadName: <String table is empty or was not found>
+# BAD-STRTAB-LLVM: 0x0000000000000001  NEEDED   Shared library: [<String table is empty or was not found>]
+# BAD-STRTAB-GNU:  0x0000000000000001 (NEEDED)  Shared library: [<String table is empty or was not found>]
----------------
Isn't it inconsistent? For line above you print `<error>`, but here you print `[<error>]`.
Was it intentional change? (it is not NFC then).


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:1973
+    return "<String table is empty or was not found>";
+  else if (Value < DynamicStringTable.size())
+    return DynamicStringTable.data() + Value;
----------------
You do not need `else` after `return`:

```
if (DynamicStringTable.empty())
  return "<String table is empty or was not found>";
if (Value < DynamicStringTable.size())
  return DynamicStringTable.data() + Value;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64674





More information about the llvm-commits mailing list