[PATCH] D63344: lld/elf: Deduplicate undefined symbol diagnostics
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 17 20:16:53 PDT 2019
ruiu added a comment.
Generally looking good, but I have one question.
Before this patch, undefined symbols are reported as we find them. Now, we buffer error messages and print them out after visiting all relocations. So the delay to get a first error message if there's an undefined symbol will increase with this patch. How long is the increase? If it is only a few hundred milliseconds, it is okay, but if it the second time scale, we may have to do this in a different way.
================
Comment at: lld/ELF/Relocations.cpp:744
- Msg += "\n>>> referenced by ";
- std::string Src = Sec.getSrcMsg(Sym, Offset);
- if (!Src.empty())
- Msg += Src + "\n>>> ";
- Msg += Sec.getObjMsg(Offset);
+ const size_t kMaxUndefReferences = 10;
+ size_t i = 0;
----------------
k -> K
or just remove k
================
Comment at: lld/ELF/Relocations.cpp:745
+ const size_t kMaxUndefReferences = 10;
+ size_t i = 0;
+ for (UndefinedDiag::Loc L : Undef.Locs) {
----------------
i -> I
================
Comment at: lld/ELF/Relocations.cpp:779
+ std::map<Symbol*, size_t> FirstRef;
+ for (size_t i = 0; i < Undefs.size(); ++i) {
+ auto& Undef = Undefs[i];
----------------
I
================
Comment at: lld/ELF/Relocations.cpp:780
+ for (size_t i = 0; i < Undefs.size(); ++i) {
+ auto& Undef = Undefs[i];
+ auto it = FirstRef.find(Undef.Sym);
----------------
auto -> UndefinedDiag
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63344/new/
https://reviews.llvm.org/D63344
More information about the llvm-commits
mailing list