Return early.

llvm-svn: 298675
This commit is contained in:
Rui Ueyama 2017-03-24 01:13:30 +00:00
parent e54785c6e9
commit c3ddb655cc
1 changed files with 4 additions and 2 deletions

View File

@ -593,10 +593,12 @@ static int64_t computeAddend(const elf::ObjectFile<ELFT> &File,
template <class ELFT>
static void reportUndefined(SymbolBody &Sym, InputSectionBase &S,
typename ELFT::uint Offset) {
if (Config->UnresolvedSymbols == UnresolvedPolicy::IgnoreAll)
return;
bool CanBeExternal = Sym.symbol()->computeBinding() != STB_LOCAL &&
Sym.getVisibility() == STV_DEFAULT;
if (Config->UnresolvedSymbols == UnresolvedPolicy::IgnoreAll ||
(Config->UnresolvedSymbols == UnresolvedPolicy::Ignore && CanBeExternal))
if (Config->UnresolvedSymbols == UnresolvedPolicy::Ignore && CanBeExternal)
return;
std::string Msg = S.getLocation<ELFT>(Offset) + ": undefined symbol '" +