[PATCH] D100375: [yaml2obj] Enable support for parsing 64-bit XCOFF.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 01:54:36 PDT 2021


jhenderson added inline comments.


================
Comment at: llvm/lib/ObjectYAML/XCOFFEmitter.cpp:287
       }
       if (PaddingSize > 0)
         W.OS.write_zeros(PaddingSize);
----------------
Esme wrote:
> jhenderson wrote:
> > Didn't notice this before when reviewing the 32-bit implementation: why is this check here? Same comment for other such checks.
> As Zheng's comment in D95505
> 
> 
> > We don't have to call write_zeros if PaddingSize is 0
> 
> 
You're right that we don't have to, but by adding the guard, you complicate the logic. Calling it is harmless.

For a similar case, you don't put an `if (!x.empty())` around a loop which iterates over the elements of `x`, for example.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100375



More information about the llvm-commits mailing list