Change createObjectFile to return an ErrorOr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199776 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-01-22 00:14:49 +00:00
parent 6220c8f960
commit 825fc31bd3
8 changed files with 31 additions and 27 deletions

View File

@ -263,12 +263,12 @@ bool DWARFUnit::parseDWO() {
sys::path::append(AbsolutePath, CompilationDir);
}
sys::path::append(AbsolutePath, DWOFileName);
object::ObjectFile *DWOFile =
ErrorOr<object::ObjectFile *> DWOFile =
object::ObjectFile::createObjectFile(AbsolutePath);
if (!DWOFile)
return false;
// Reset DWOHolder.
DWO.reset(new DWOHolder(DWOFile));
DWO.reset(new DWOHolder(DWOFile.get()));
DWARFUnit *DWOCU = DWO->getUnit();
// Verify that compile unit in .dwo file is valid.
if (DWOCU == 0 || DWOCU->getDWOId() != getDWOId()) {