aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/PDB.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-05-06 20:51:57 +0000
committerZachary Turner <zturner@google.com>2016-05-06 20:51:57 +0000
commit819e77d196f208cc8ef15b4186e07ecb14a115c8 (patch)
tree409e2ff42a99563c75759c4c22116c35eb60569c /llvm/lib/DebugInfo/PDB/PDB.cpp
parent091fcfa3a7632b6bbfbefdac84e0425d827d288c (diff)
downloadllvm-819e77d196f208cc8ef15b4186e07ecb14a115c8.zip
llvm-819e77d196f208cc8ef15b4186e07ecb14a115c8.tar.gz
llvm-819e77d196f208cc8ef15b4186e07ecb14a115c8.tar.bz2
Port DebugInfoPDB over to using llvm::Error.
Differential Revision: http://reviews.llvm.org/D19940 Reviewed By: rnk llvm-svn: 268791
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDB.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDB.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDB.cpp b/llvm/lib/DebugInfo/PDB/PDB.cpp
index 1c65e85..2b384aa 100644
--- a/llvm/lib/DebugInfo/PDB/PDB.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDB.cpp
@@ -13,17 +13,18 @@
#include "llvm/Config/config.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/PDB.h"
-
#if HAVE_DIA_SDK
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
#endif
#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/ManagedStatic.h"
using namespace llvm;
using namespace llvm::pdb;
-PDB_ErrorCode llvm::pdb::loadDataForPDB(PDB_ReaderType Type, StringRef Path,
- std::unique_ptr<IPDBSession> &Session) {
+Error llvm::pdb::loadDataForPDB(PDB_ReaderType Type, StringRef Path,
+ std::unique_ptr<IPDBSession> &Session) {
// Create the correct concrete instance type based on the value of Type.
if (Type == PDB_ReaderType::Raw)
return RawSession::createFromPdb(Path, Session);
@@ -31,12 +32,12 @@ PDB_ErrorCode llvm::pdb::loadDataForPDB(PDB_ReaderType Type, StringRef Path,
#if HAVE_DIA_SDK
return DIASession::createFromPdb(Path, Session);
#else
- return PDB_ErrorCode::NoDiaSupport;
+ return llvm::make_error<GenericError>("DIA is not installed on the system");
#endif
}
-PDB_ErrorCode llvm::pdb::loadDataForEXE(PDB_ReaderType Type, StringRef Path,
- std::unique_ptr<IPDBSession> &Session) {
+Error llvm::pdb::loadDataForEXE(PDB_ReaderType Type, StringRef Path,
+ std::unique_ptr<IPDBSession> &Session) {
// Create the correct concrete instance type based on the value of Type.
if (Type == PDB_ReaderType::Raw)
return RawSession::createFromExe(Path, Session);
@@ -44,6 +45,6 @@ PDB_ErrorCode llvm::pdb::loadDataForEXE(PDB_ReaderType Type, StringRef Path,
#if HAVE_DIA_SDK
return DIASession::createFromExe(Path, Session);
#else
- return PDB_ErrorCode::NoDiaSupport;
+ return llvm::make_error<GenericError>("DIA is not installed on the system");
#endif
}