[PATCH] D47791: Initial support for Hexagon target.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 5 11:27:36 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/Arch/Hexagon.cpp:47
+  for (size_t Bit = 0; Bit != 32; ++Bit) {
+    const bool ValBit = (Data >> Off) & 1;
+    const bool MaskBit = (Mask >> Bit) & 1;
----------------
We normally don't add `const` if the variable's scope is narrow.


================
Comment at: ELF/Arch/Hexagon.cpp:72
+  case R_HEX_B22_PCREL: {
+    uint32_t EffectiveValue = (Val >> 2) & 0x3fffff;
+    EffectiveValue = applyMask(0x01ff3ffe, EffectiveValue);
----------------
We usually use much shorter variable name for a variable whose scope is very narrow. Just `V` would be enough for this.



================
Comment at: ELF/Arch/Hexagon.cpp:74
+    EffectiveValue = applyMask(0x01ff3ffe, EffectiveValue);
+    write32le(Loc, (read32le(Loc) | EffectiveValue));
+    break;
----------------
I believe we have `or32le`.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47791





More information about the llvm-commits mailing list