[lld] r192424 - Propagate Resolver::resolveUndefines()'s failure to caller.
Rui Ueyama
ruiu at google.com
Thu Oct 10 23:26:16 PDT 2013
Author: ruiu
Date: Fri Oct 11 01:26:16 2013
New Revision: 192424
URL: http://llvm.org/viewvc/llvm-project?rev=192424&view=rev
Log:
Propagate Resolver::resolveUndefines()'s failure to caller.
Modified:
lld/trunk/include/lld/Core/Resolver.h
lld/trunk/lib/Core/Resolver.cpp
Modified: lld/trunk/include/lld/Core/Resolver.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Resolver.h?rev=192424&r1=192423&r2=192424&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Resolver.h (original)
+++ lld/trunk/include/lld/Core/Resolver.h Fri Oct 11 01:26:16 2013
@@ -69,7 +69,7 @@ public:
private:
/// \brief The main function that iterates over the files to resolve
- void resolveUndefines();
+ bool resolveUndefines();
void updateReferences();
void deadStripOptimize();
bool checkUndefines(bool final);
Modified: lld/trunk/lib/Core/Resolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Resolver.cpp?rev=192424&r1=192423&r2=192424&view=diff
==============================================================================
--- lld/trunk/lib/Core/Resolver.cpp (original)
+++ lld/trunk/lib/Core/Resolver.cpp Fri Oct 11 01:26:16 2013
@@ -289,20 +289,20 @@ void Resolver::addAtoms(const std::vecto
}
}
-// Ask symbol table if any undefined atoms still exist. If so, keep searching
-// libraries until no more atoms being added.
-void Resolver::resolveUndefines() {
+// Keep adding atoms until _context.nextFile() returns an error. This function
+// is where undefined atoms are resolved.
+bool Resolver::resolveUndefines() {
ScopedTask task(getDefaultDomain(), "resolveUndefines");
for (;;) {
ErrorOr<File &> file = _context.nextFile();
_context.setResolverState(Resolver::StateNoChange);
if (error_code(file) == InputGraphError::no_more_files)
- return;
+ return true;
if (!file) {
llvm::errs() << "Error occurred in nextFile: "
<< error_code(file).message() << "\n";
- return;
+ return false;
}
switch (file->kind()) {
@@ -470,7 +470,8 @@ void Resolver::linkTimeOptimize() {
}
bool Resolver::resolve() {
- this->resolveUndefines();
+ if (!this->resolveUndefines())
+ return false;
this->updateReferences();
this->deadStripOptimize();
if (this->checkUndefines(false)) {
More information about the llvm-commits
mailing list