Resolver: Do not use assert() to notify user input error.

llvm-svn: 189775
This commit is contained in:
Rui Ueyama 2013-09-03 00:50:22 +00:00
parent 900a501bdd
commit 4313451ba4
1 changed files with 5 additions and 1 deletions

View File

@ -293,7 +293,11 @@ void Resolver::deadStripOptimize() {
// Or, use list of names that are dead stip roots. // Or, use list of names that are dead stip roots.
for (const StringRef &name : _context.deadStripRoots()) { for (const StringRef &name : _context.deadStripRoots()) {
const Atom *symAtom = _symbolTable.findByName(name); const Atom *symAtom = _symbolTable.findByName(name);
assert(symAtom->definition() != Atom::definitionUndefined); if (symAtom->definition() == Atom::definitionUndefined) {
llvm::errs() << "Dead strip root '" << symAtom->name()
<< "' is not defined\n";
return;
}
_deadStripRoots.insert(symAtom); _deadStripRoots.insert(symAtom);
} }