[PATCH] D69411: [MC] Resolve the difference of symbols in consecutive MCDataFragements

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 14:47:51 PDT 2020


psmith added a comment.

Thanks for the update and sorry to take so long to comment. I can't see anything immediately wrong and I think limiting this to fragments in the same subsection makes sense.



================
Comment at: llvm/lib/MC/MCExpr.cpp:649
+      return;
+    int64_t Offset = SA.getOffset() - SB.getOffset();
+    for (auto FI = FB->getIterator(), FE = SecA.end(); FI != FE; ++FI) {
----------------
It would be good to have a comment here as we have Offset and getOffset() meaning two different things. IIUC getOffset() is really getOffsetWithinFragment(). Perhaps use Displacement instead of Offset as the accumulating variable name.

For example:
// Try to find a constant displacement from FA to FB, add the displacement between the offset in FA of SA and the offset in FB of SB. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69411



More information about the llvm-commits mailing list