forked from OSchip/llvm-project
Only report first error when no compilation database is found.
Review: http://llvm-reviews.chandlerc.com/D62 llvm-svn: 165933
This commit is contained in:
parent
16205cd4fa
commit
74351ff4ac
|
@ -49,14 +49,19 @@ static CompilationDatabase *
|
|||
findCompilationDatabaseFromDirectory(StringRef Directory,
|
||||
std::string &ErrorMessage) {
|
||||
std::stringstream ErrorStream;
|
||||
bool HasErrorMessage = false;
|
||||
while (!Directory.empty()) {
|
||||
std::string LoadErrorMessage;
|
||||
|
||||
if (CompilationDatabase *DB =
|
||||
CompilationDatabase::loadFromDirectory(Directory, LoadErrorMessage))
|
||||
return DB;
|
||||
ErrorStream << "No compilation database found in " << Directory.str()
|
||||
<< "\n" << LoadErrorMessage;
|
||||
|
||||
if (!HasErrorMessage) {
|
||||
ErrorStream << "No compilation database found in " << Directory.str()
|
||||
<< " or any parent directory\n" << LoadErrorMessage;
|
||||
HasErrorMessage = true;
|
||||
}
|
||||
|
||||
Directory = llvm::sys::path::parent_path(Directory);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue