[lld] r205567 - Early return.
Rui Ueyama
ruiu at google.com
Thu Apr 3 14:00:03 PDT 2014
Author: ruiu
Date: Thu Apr 3 16:00:03 2014
New Revision: 205567
URL: http://llvm.org/viewvc/llvm-project?rev=205567&view=rev
Log:
Early return.
Modified:
lld/trunk/lib/Core/Resolver.cpp
Modified: lld/trunk/lib/Core/Resolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Resolver.cpp?rev=205567&r1=205566&r2=205567&view=diff
==============================================================================
--- lld/trunk/lib/Core/Resolver.cpp (original)
+++ lld/trunk/lib/Core/Resolver.cpp Thu Apr 3 16:00:03 2014
@@ -69,6 +69,11 @@ private:
} // namespace
void Resolver::handleFile(const File &file) {
+ bool isEmpty = file.defined().empty() && file.sharedLibrary().empty() &&
+ file.absolute().empty() && file.undefined().empty();
+ if (isEmpty)
+ return;
+
for (const DefinedAtom *atom : file.defined())
doDefinedAtom(*atom);
@@ -90,13 +95,10 @@ void Resolver::handleFile(const File &fi
for (const AbsoluteAtom *atom : file.absolute())
doAbsoluteAtom(*atom);
- // If we make some progress on linking, notify that fact to the input file
- // manager, because it may want to know that for --start-group/end-group.
- bool progress = !file.defined().empty() || !file.sharedLibrary().empty() ||
- !file.absolute().empty() || !file.undefined().empty();
- if (progress) {
- _context.inputGraph().notifyProgress();
- }
+ // Notify the input file manager of the fact that we have made some progress
+ // on linking using the current input file. It may want to know the fact for
+ // --start-group/--end-group.
+ _context.inputGraph().notifyProgress();
}
void Resolver::forEachUndefines(UndefCallback callback,
More information about the llvm-commits
mailing list