diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDB.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/PDB.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDB.cpp b/llvm/lib/DebugInfo/PDB/PDB.cpp index 1c65e85345f..2b384aaba18 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 } |