[PATCH] D58943: [RISCV][MC] Find matching pcrel_hi fixup in more cases.

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 05:53:01 PST 2019


lewis-revill added a comment.

On balance this patch seems a more appropriate solution given it doesn't touch generic code. I hope there isn't a case that isn't covered by this because I honestly can't think of one.



================
Comment at: lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp:53
+  const MCSymbol *AUIPCSymbol = &AUIPCSRE->getSymbol();
+  const auto *DF = dyn_cast_or_null<MCDataFragment>(AUIPCSymbol->getFragment());
+
----------------
Perhaps I'm missing something, but I don't quite follow why this change (`AUIPCSRE->findAssociatedFragment()` -> `AUIPCSymbol->getFragment()`) was made?


================
Comment at: lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp:59
+  uint64_t Offset = AUIPCSymbol->getOffset();
+  if (DF->getContents().size() == Offset) {
+    DF = dyn_cast_or_null<MCDataFragment>(DF->getNextNode());
----------------
Nitpick: could we swap this to `Offset == DF->getContents().size()`?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58943





More information about the llvm-commits mailing list