[PATCH] D98437: [SystemZ][z/OS] Add GOFFObjectFile class support for HDR, ESD and END records

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 12:37:05 PDT 2021


MaskRay added inline comments.


================
Comment at: llvm/include/llvm/Object/GOFF.h:110
+    uint8_t Mask = ((1 << Length) - 1) << (8 - BitIndex - Length);
+    Value = (Value & Mask) >> (8 - BitIndex - Length);
+  }
----------------
Shift then take a bitand, then you can remove `Mask`.


================
Comment at: llvm/include/llvm/Object/GOFF.h:115
+  static void get(const uint8_t *Bytes, uint8_t ByteIndex, T &Value) {
+    assert(ByteIndex + sizeof(T) - 1 < GOFF::RecordLength &&
+           "Byte index out of bounds!");
----------------
`ByteIndex + sizeof(T) <= `


================
Comment at: llvm/include/llvm/Object/GOFF.h:153
+  void setEsdId(uint32_t EsdId) { set<uint32_t>(4, EsdId); }
+
+  void setParentEsdId(uint32_t EsdId) { set<uint32_t>(8, EsdId); }
----------------
Set empty lines probably do not improve readability and should be deleted.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98437



More information about the llvm-commits mailing list