summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
index d81f59400eb..f133b7ff77f 100644
--- a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
+++ b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
@@ -42,7 +42,7 @@ static Error ErrorFromHResult(HRESULT Result, const char *Str, Ts &&... Args) {
switch (Result) {
case E_PDB_NOT_FOUND:
- return make_error<GenericError>(generic_error_code::invalid_path, Context);
+ return errorCodeToError(std::error_code(ENOENT, std::generic_category()));
case E_PDB_FORMAT:
return make_error<DIAError>(dia_error_code::invalid_file_format, Context);
case E_INVALIDARG:
@@ -71,8 +71,7 @@ static Error LoadDIA(CComPtr<IDiaDataSource> &DiaDataSource) {
// If the CoCreateInstance call above failed, msdia*.dll is not registered.
// Try loading the DLL corresponding to the #included DIA SDK.
#if !defined(_MSC_VER)
- return llvm::make_error<GenericError>(
- "DIA is only supported when using MSVC.");
+ return llvm::make_error<PDBError>(pdb_error_code::dia_failed_loading);
#else
const wchar_t *msdia_dll = nullptr;
#if _MSC_VER >= 1900 && _MSC_VER < 2000
@@ -104,7 +103,7 @@ Error DIASession::createFromPdb(StringRef Path,
llvm::SmallVector<UTF16, 128> Path16;
if (!llvm::convertUTF8ToUTF16String(Path, Path16))
- return make_error<GenericError>(generic_error_code::invalid_path);
+ return make_error<PDBError>(pdb_error_code::invalid_utf8_path, Path);
const wchar_t *Path16Str = reinterpret_cast<const wchar_t *>(Path16.data());
HRESULT HR;
@@ -130,7 +129,7 @@ Error DIASession::createFromExe(StringRef Path,
llvm::SmallVector<UTF16, 128> Path16;
if (!llvm::convertUTF8ToUTF16String(Path, Path16))
- return make_error<GenericError>(generic_error_code::invalid_path, Path);
+ return make_error<PDBError>(pdb_error_code::invalid_utf8_path, Path);
const wchar_t *Path16Str = reinterpret_cast<const wchar_t *>(Path16.data());
HRESULT HR;
OpenPOWER on IntegriCloud