[PATCH] D53044: [ELF] Don't warn on undefined symbols if UnresolvedPolicy::Ignore is used
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 10 15:10:55 PDT 2018
ruiu added inline comments.
================
Comment at: ELF/Symbols.cpp:280-288
Warn(": unable to order shared symbol: ");
- else if (D && !D->Section)
- Warn(": unable to order absolute symbol: ");
- else if (D && isa<OutputSection>(D->Section))
- Warn(": unable to order synthetic symbol: ");
- else if (D && !D->Section->Repl->Live)
- Warn(": unable to order discarded symbol: ");
+ } else if (D) {
+ if (!D->Section)
+ Warn(": unable to order absolute symbol: ");
+ else if (isa<OutputSection>(D->Section))
+ Warn(": unable to order synthetic symbol: ");
+ else if (!D->Section->Repl->Live)
----------------
MaskRay wrote:
> ruiu wrote:
> > Please do not change this -- this code was written in the way it is to reduce indentation depth.
> Should I use `if (Sym->isUndefined() && Config->UnresolvedSymbols != UnresolvedPolicy::Ignore)` then?
>
> I actually find dispatching by `SymbolKind` first makes the code a bit easier to understand:
>
> * Undefined
> * Shared
> * Others (Defined)
>
> For the `Defined` case, fine-grained conditions are checked for absolute/syunthetic/discarded.
>
> I lean to this style but if you have strong opinion on this, I can change it.
Yeah, maybe you should write that `if` at the beginning of this function to exit early.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D53044
More information about the llvm-commits
mailing list