aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
diff options
context:
space:
mode:
authorAmy Huang <akhuang@google.com>2020-04-21 12:34:42 -0700
committerAmy Huang <akhuang@google.com>2020-04-21 12:36:55 -0700
commit1e1f5eb7c978da3b062daaf3c32c459704e65a55 (patch)
treeebc2f95bc774982b8f9c808c9ae69f82e4882a2f /llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
parenta6c1692cb30e62c94513c2c6262cd76df92ef892 (diff)
downloadllvm-1e1f5eb7c978da3b062daaf3c32c459704e65a55.zip
llvm-1e1f5eb7c978da3b062daaf3c32c459704e65a55.tar.gz
llvm-1e1f5eb7c978da3b062daaf3c32c459704e65a55.tar.bz2
[NativeSession] Fix unchecked Expected type
(followup to https://reviews.llvm.org/D78128)
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
index 73a28ff..d12fec9 100644
--- a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
@@ -173,8 +173,11 @@ NativeSession::searchForPdb(const PdbSearchOptions &Opts) {
sys::path::append(PdbPath, PdbName);
auto Allocator = std::make_unique<BumpPtrAllocator>();
- if (loadPdbFile(PdbPath, Allocator))
+
+ if (auto File = loadPdbFile(PdbPath, Allocator))
return std::string(PdbPath);
+ else
+ return File.takeError();
return make_error<RawError>("PDB not found");
}