aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/PDB.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-02-28 20:23:18 +0000
committerZachary Turner <zturner@google.com>2015-02-28 20:23:18 +0000
commitccf04159732d5da1430a44a96f0211f05ba7cf9e (patch)
tree00ed7d60fdbaa5dc56ae919a52d9ddd87c8aec7f /llvm/lib/DebugInfo/PDB/PDB.cpp
parent66d4c6e78cef2aad52b7a0344a5afc073c638ca9 (diff)
downloadllvm-ccf04159732d5da1430a44a96f0211f05ba7cf9e.zip
llvm-ccf04159732d5da1430a44a96f0211f05ba7cf9e.tar.gz
llvm-ccf04159732d5da1430a44a96f0211f05ba7cf9e.tar.bz2
[llvm-pdbdump] Better error handling.
Previously it was impossible to distinguish between "There is no PDB implementation for this platform" and "I tried to load the PDB, but couldn't find the file", making it hard to figure out if you built llvm-pdbdump incorrectly or if you just mistyped a file name. This patch adds proper error handling so that we can know exactly what went wrong. llvm-svn: 230868
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDB.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDB.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDB.cpp b/llvm/lib/DebugInfo/PDB/PDB.cpp
index aa84c28..a07396d 100644
--- a/llvm/lib/DebugInfo/PDB/PDB.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDB.cpp
@@ -20,11 +20,11 @@
using namespace llvm;
-std::unique_ptr<IPDBSession> llvm::createPDBReader(PDB_ReaderType Type,
- StringRef Path) {
+PDB_ErrorCode llvm::createPDBReader(PDB_ReaderType Type, StringRef Path,
+ std::unique_ptr<IPDBSession> &Session) {
// Create the correct concrete instance type based on the value of Type.
#if HAVE_DIA_SDK
- return std::unique_ptr<DIASession>(DIASession::createFromPdb(Path));
+ return DIASession::createFromPdb(Path, Session);
#endif
- return nullptr;
+ return PDB_ErrorCode::NoPdbImpl;
}