[PATCH] D58441: [yaml2obj] - Simplify implementation. NFCI.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 20 05:46:54 PST 2019


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: tools/yaml2obj/yaml2elf.cpp:580
       CBA.getOSAndAlignedOffset(SHeader.sh_offset, SHeader.sh_addralign);
-  for (uint16_t V : Section.Entries) {
-    Elf_Half Version = (Elf_Half)V;
-    OS.write((const char *)&Version, sizeof(Elf_Half));
-  }
+  for (uint16_t V : Section.Entries)
+    support::endian::write<uint16_t>(OS, V, ELFT::TargetEndianness);
----------------
I'd rename this from `V` to `Version`, so that it's a little easier to understand.


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

https://reviews.llvm.org/D58441





More information about the llvm-commits mailing list