[PATCH] D152945: [SystemZ][z/OS] Implement executePostLayoutBinding for GOFFWriter

Neumann Hon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 16:13:45 PDT 2023


Everybody0523 added inline comments.


================
Comment at: llvm/lib/MC/GOFFObjectWriter.cpp:705
+    Flags Attr[10];
+    void setAmode(GOFF::ESDAmode Amode) { Attr[0].set(0, 8, Amode); }
+    void setRmode(GOFF::ESDRmode Rmode) { Attr[1].set(0, 8, Rmode); }
----------------
DiggerLin wrote:
> I am expressing the difficulty in understanding the meaning or significance of the values 0, 8 in a particular context. it's possible to use a "static constexpr" to define these values to provide more clarity and context? 
> 
> if can , please change all the following .
> 
> for example: in xcoff.h
> 
> constexpr size_t FileNamePadSize = 6;
> constexpr size_t NameSize = 8;
> constexpr size_t FileHeaderSize32 = 20;
> constexpr size_t FileHeaderSize64 = 24;
> 
So in the highlighted function (`setAmode`), we're setting the address mode of the symbol, which is an 8-bit field. The first parameter of the `set()` function is the offset to which we begin, the second parameter is the number of bits that should be written, and the last value is the actual value to write, so in this case we just mean "0-bit offset" and "write 8 bits" for the 0 and 8 respectively.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152945



More information about the llvm-commits mailing list