[PATCH] D47791: Initial support for Hexagon target.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 11:29:12 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/Arch/Hexagon.cpp:26
+namespace {
+class HexagonReloc final : public TargetInfo {
+public:
----------------
Please read other files in the same directory and follow the same naming convention. This should be named just `Hexagon`.


================
Comment at: ELF/Arch/Hexagon.cpp:38
+uint32_t HexagonReloc::calcEFlags() const {
+  assert(!ObjectFiles.empty());
+  return 0x60;
----------------
You don't need this assert as you are not depending on it.


================
Comment at: ELF/Arch/Hexagon.cpp:50
+    if (MaskBit) {
+      Result |= (ValBit << Bit);
+      ++Off;
----------------
I believe ValBit (which is `bool`) is promoted to int because of the usual integer promotion before << is applied, but this is perhaps a bit confusing. It is better to make their types `uint32_t`.


================
Comment at: ELF/Arch/Hexagon.cpp:73
+    break;
+  case R_HEX_B22_PCREL: {
+    or32le(Loc, applyMask(0x01ff3ffe, ((Val >> 2) & 0x3fffff)));
----------------
You don't need {} if you do not define a new variable inside {}.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47791





More information about the llvm-commits mailing list