[PATCH] D63344: lld/elf: Deduplicate undefined symbol diagnostics

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 01:45:21 PDT 2019


MaskRay added inline comments.


================
Comment at: lld/ELF/Relocations.cpp:718
+  std::vector<Loc> Locs;
+  bool IsWarning;
+};
----------------
grimar wrote:
> Seems this field can be calculated at any time, does it worth to keep the precalculated value?
`IsWarning` is computed on a per-symbol basis:

```
bool CanBeExternal = !Sym.isLocal() && Sym.computeBinding() != STB_LOCAL &&
                       Sym.Visibility == STV_DEFAULT;

  bool IsWarning =
      (Config->UnresolvedSymbols == UnresolvedPolicy::Warn && CanBeExternal) ||
      Config->NoinhibitExec;

```


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

https://reviews.llvm.org/D63344





More information about the llvm-commits mailing list