[PATCH] D93925: [ELF] Drop '>>> defined in ' for locations of linker synthesized symbols

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 30 00:44:07 PST 2020


grimar accepted this revision.
grimar added a comment.
This revision is now accepted and ready to land.

LGTM with or without my suggestion.



================
Comment at: lld/ELF/Relocations.cpp:82
+    return msg + *loc;
+  return {};
 }
----------------
`return "";` might look cleaner here, because a string is returned.

Also, I'd get probably rid of `msg` variable, because it is not used for all paths now:

```
static std::string getDefinedLocation(const Symbol &sym) {
  if (sym.file)
    return "\n>>> defined in " + toString(sym.file);
  if (Optional<std::string> loc = getLinkerScriptLocation(sym))
    return "\n>>> defined in " + *loc;
  return "";
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93925



More information about the llvm-commits mailing list