summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-05-24 17:12:10 +0000
committerRui Ueyama <ruiu@google.com>2017-05-24 17:12:10 +0000
commitd6489635f4d4bd5c43904143347d65c1463d2886 (patch)
treecb1172598d2d85a59655a1744588d09f97d76e87
parent77e07cc0109b5f6b7feb7dc72eda01f656b164af (diff)
downloadbcm5719-llvm-d6489635f4d4bd5c43904143347d65c1463d2886.tar.gz
bcm5719-llvm-d6489635f4d4bd5c43904143347d65c1463d2886.zip
Change the control flow so that the function is a bit more readable. NFC.
llvm-svn: 303775
-rw-r--r--lld/COFF/InputFiles.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 6e6465cd5d6..418344630f0 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -48,13 +48,11 @@ namespace coff {
/// alias to Target.
static void checkAndSetWeakAlias(SymbolTable *Symtab, InputFile *F,
SymbolBody *Source, SymbolBody *Target) {
- auto *U = dyn_cast<Undefined>(Source);
- if (!U)
- return;
- else if (!U->WeakAlias)
+ if (auto *U = dyn_cast<Undefined>(Source)) {
+ if (U->WeakAlias && U->WeakAlias != Target)
+ Symtab->reportDuplicate(Source->symbol(), F);
U->WeakAlias = Target;
- else if (U->WeakAlias != Target)
- Symtab->reportDuplicate(Source->symbol(), F);
+ }
}
ArchiveFile::ArchiveFile(MemoryBufferRef M) : InputFile(ArchiveKind, M) {}
OpenPOWER on IntegriCloud