[PATCH] D93362: [llvm-elfabi] Support ELF file that lacks .gnu.hash section

Haowei Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 01:23:26 PST 2021


haowei added inline comments.


================
Comment at: llvm/include/llvm/Object/ELF.h:567-569
+            "SHT_DYNSYM section has sh_size (" + Twine(Sec.sh_size).str() +
+                ") % sh_entsize (" + Twine(Sec.sh_entsize).str() +
+                ") that is not 0");
----------------
jhenderson wrote:
> `Twine + Twine` produces a new `Twine`, and IIRC string literals get converted to `Twine`s to allow this to happen. `Twine` is intended for efficient string concatenation, so you concatenate all the `Twine` instances, and then convert it to a string using `.str()` as demonstrated.
Actually createStringError can take a `const Twine &` parameter directly, so I removed str() since it is not necessary. Does it look good?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93362



More information about the llvm-commits mailing list