forked from OSchip/llvm-project
Propagate Resolver::resolveUndefines()'s failure to caller.
llvm-svn: 192424
This commit is contained in:
parent
f1e266846d
commit
2ad117db97
|
@ -69,7 +69,7 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// \brief The main function that iterates over the files to resolve
|
/// \brief The main function that iterates over the files to resolve
|
||||||
void resolveUndefines();
|
bool resolveUndefines();
|
||||||
void updateReferences();
|
void updateReferences();
|
||||||
void deadStripOptimize();
|
void deadStripOptimize();
|
||||||
bool checkUndefines(bool final);
|
bool checkUndefines(bool final);
|
||||||
|
|
|
@ -289,20 +289,20 @@ void Resolver::addAtoms(const std::vector<const DefinedAtom*>& newAtoms) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ask symbol table if any undefined atoms still exist. If so, keep searching
|
// Keep adding atoms until _context.nextFile() returns an error. This function
|
||||||
// libraries until no more atoms being added.
|
// is where undefined atoms are resolved.
|
||||||
void Resolver::resolveUndefines() {
|
bool Resolver::resolveUndefines() {
|
||||||
ScopedTask task(getDefaultDomain(), "resolveUndefines");
|
ScopedTask task(getDefaultDomain(), "resolveUndefines");
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
ErrorOr<File &> file = _context.nextFile();
|
ErrorOr<File &> file = _context.nextFile();
|
||||||
_context.setResolverState(Resolver::StateNoChange);
|
_context.setResolverState(Resolver::StateNoChange);
|
||||||
if (error_code(file) == InputGraphError::no_more_files)
|
if (error_code(file) == InputGraphError::no_more_files)
|
||||||
return;
|
return true;
|
||||||
if (!file) {
|
if (!file) {
|
||||||
llvm::errs() << "Error occurred in nextFile: "
|
llvm::errs() << "Error occurred in nextFile: "
|
||||||
<< error_code(file).message() << "\n";
|
<< error_code(file).message() << "\n";
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (file->kind()) {
|
switch (file->kind()) {
|
||||||
|
@ -470,7 +470,8 @@ void Resolver::linkTimeOptimize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Resolver::resolve() {
|
bool Resolver::resolve() {
|
||||||
this->resolveUndefines();
|
if (!this->resolveUndefines())
|
||||||
|
return false;
|
||||||
this->updateReferences();
|
this->updateReferences();
|
||||||
this->deadStripOptimize();
|
this->deadStripOptimize();
|
||||||
if (this->checkUndefines(false)) {
|
if (this->checkUndefines(false)) {
|
||||||
|
|
Loading…
Reference in New Issue