[llvm] 1e1f5eb - [NativeSession] Fix unchecked Expected type
Amy Huang via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 21 12:37:07 PDT 2020
Author: Amy Huang
Date: 2020-04-21T12:36:55-07:00
New Revision: 1e1f5eb7c978da3b062daaf3c32c459704e65a55
URL: https://github.com/llvm/llvm-project/commit/1e1f5eb7c978da3b062daaf3c32c459704e65a55
DIFF: https://github.com/llvm/llvm-project/commit/1e1f5eb7c978da3b062daaf3c32c459704e65a55.diff
LOG: [NativeSession] Fix unchecked Expected type
(followup to https://reviews.llvm.org/D78128)
Added:
Modified:
llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
index 73a28ff37760..d12fec9c8329 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");
}
More information about the llvm-commits
mailing list