ELF2: Return early. NFC.

llvm-svn: 247165
This commit is contained in:
Rui Ueyama 2015-09-09 17:40:51 +00:00
parent 84f5b0df8e
commit 7da94a58a0
1 changed files with 16 additions and 17 deletions

View File

@ -51,27 +51,26 @@ template <class ELFT> int SymbolBody::compare(SymbolBody *Other) {
if (L != R)
return -1;
if (L.first && L.second) {
if (isCommon()) {
if (Other->isCommon()) {
auto *ThisC = cast<DefinedCommon<ELFT>>(this);
auto *OtherC = cast<DefinedCommon<ELFT>>(Other);
typename DefinedCommon<ELFT>::uintX_t MaxAlign =
std::max(ThisC->MaxAlignment, OtherC->MaxAlignment);
if (ThisC->Sym.st_size >= OtherC->Sym.st_size) {
ThisC->MaxAlignment = MaxAlign;
return 1;
}
OtherC->MaxAlignment = MaxAlign;
return -1;
if (!L.first || !L.second)
return 1;
if (isCommon()) {
if (Other->isCommon()) {
auto *ThisC = cast<DefinedCommon<ELFT>>(this);
auto *OtherC = cast<DefinedCommon<ELFT>>(Other);
typename DefinedCommon<ELFT>::uintX_t MaxAlign =
std::max(ThisC->MaxAlignment, OtherC->MaxAlignment);
if (ThisC->Sym.st_size >= OtherC->Sym.st_size) {
ThisC->MaxAlignment = MaxAlign;
return 1;
}
OtherC->MaxAlignment = MaxAlign;
return -1;
}
if (Other->isCommon())
return 1;
return 0;
return -1;
}
return 1;
if (Other->isCommon())
return 1;
return 0;
}
std::unique_ptr<InputFile> Lazy::getMember() {