[PATCH] D87584: [lld-macho] In the context of relocs, s/target/referent/ for sections & symbols

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 18:03:01 PDT 2020


int3 accepted this revision.
int3 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/MachO/Writer.cpp:316
     for (Reloc &r : isec->relocs) {
-      if (auto *s = r.target.dyn_cast<lld::macho::Symbol *>()) {
-        if (isa<Undefined>(s))
-          error("undefined symbol " + s->getName() + ", referenced from " +
+      if (auto *referentSym = r.referent.dyn_cast<lld::macho::Symbol *>()) {
+        if (isa<Undefined>(referentSym))
----------------
IMO `s` or `sym` is fine here, there's no confusion about what it's referring to within the body of this method


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87584



More information about the llvm-commits mailing list