[lld] r235708 - [Mips] Simplify the code a bit using early return
Simon Atanasyan
simon at atanasyan.com
Fri Apr 24 04:14:24 PDT 2015
Author: atanasyan
Date: Fri Apr 24 06:14:24 2015
New Revision: 235708
URL: http://llvm.org/viewvc/llvm-project?rev=235708&view=rev
Log:
[Mips] Simplify the code a bit using early return
No functional changes.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=235708&r1=235707&r2=235708&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Fri Apr 24 06:14:24 2015
@@ -734,21 +734,13 @@ bool RelocationPass<ELFT>::isDynamic(con
const auto *da = dyn_cast<const DefinedAtom>(atom);
if (da && da->dynamicExport() == DefinedAtom::dynamicExportAlways)
return true;
-
- const auto *sa = dyn_cast<SharedLibraryAtom>(atom);
- if (sa)
+ if (isa<SharedLibraryAtom>(atom))
return true;
-
- if (_ctx.getOutputELFType() == ET_DYN) {
- if (da && da->scope() != DefinedAtom::scopeTranslationUnit)
- return true;
-
- const auto *ua = dyn_cast<UndefinedAtom>(atom);
- if (ua)
- return true;
- }
-
- return false;
+ if (_ctx.getOutputELFType() != ET_DYN)
+ return false;
+ if (da && da->scope() != DefinedAtom::scopeTranslationUnit)
+ return true;
+ return isa<UndefinedAtom>(atom);
}
template <typename ELFT>
More information about the llvm-commits
mailing list