LLVM
13.0.0git
lib
DebugInfo
PDB
DIA
DIAError.cpp
Go to the documentation of this file.
1
#include "
llvm/DebugInfo/PDB/DIA/DIAError.h
"
2
#include "
llvm/Support/ErrorHandling.h
"
3
#include "
llvm/Support/ManagedStatic.h
"
4
5
using namespace
llvm
;
6
using namespace
llvm::pdb
;
7
8
// FIXME: This class is only here to support the transition to llvm::Error. It
9
// will be removed once this transition is complete. Clients should prefer to
10
// deal with the Error value directly, rather than converting to error_code.
11
class
DIAErrorCategory
:
public
std::error_category
{
12
public
:
13
const
char
*
name
()
const
noexcept
override
{
return
"llvm.pdb.dia"
; }
14
std::string
message
(
int
Condition)
const override
{
15
switch
(
static_cast<
dia_error_code
>
(Condition)) {
16
case
dia_error_code::could_not_create_impl
:
17
return
"Failed to connect to DIA at runtime. Verify that Visual Studio "
18
"is properly installed, or that msdiaXX.dll is in your PATH."
;
19
case
dia_error_code::invalid_file_format
:
20
return
"Unable to load PDB. The file has an unrecognized format."
;
21
case
dia_error_code::invalid_parameter
:
22
return
"The parameter is incorrect."
;
23
case
dia_error_code::already_loaded
:
24
return
"Unable to load the PDB or EXE, because it is already loaded."
;
25
case
dia_error_code::debug_info_mismatch
:
26
return
"The PDB file and the EXE file do not match."
;
27
case
dia_error_code::unspecified
:
28
return
"An unknown error has occurred."
;
29
}
30
llvm_unreachable
(
"Unrecognized DIAErrorCode"
);
31
}
32
};
33
34
static
llvm::ManagedStatic<DIAErrorCategory>
DIACategory
;
35
const
std::error_category
&
llvm::pdb::DIAErrCategory
() {
return
*
DIACategory
; }
36
37
char
DIAError::ID
;
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:23
llvm::pdb::DIAError::ID
static char ID
Definition:
DIAError.h:46
ErrorHandling.h
ManagedStatic.h
llvm::pdb::dia_error_code::could_not_create_impl
@ could_not_create_impl
llvm::pdb::dia_error_code::unspecified
@ unspecified
llvm::pdb::dia_error_code
dia_error_code
Definition:
DIAError.h:17
llvm::pdb::dia_error_code::invalid_file_format
@ invalid_file_format
llvm::ManagedStatic
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
Definition:
ManagedStatic.h:83
llvm::pdb::dia_error_code::debug_info_mismatch
@ debug_info_mismatch
llvm::pdb
Definition:
ConcreteSymbolEnumerator.h:20
const
aarch64 promote const
Definition:
AArch64PromoteConstant.cpp:232
llvm::pdb::dia_error_code::already_loaded
@ already_loaded
DIACategory
static llvm::ManagedStatic< DIAErrorCategory > DIACategory
Definition:
DIAError.cpp:34
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:
ErrorHandling.h:136
llvm::pdb::dia_error_code::invalid_parameter
@ invalid_parameter
DIAErrorCategory::message
std::string message(int Condition) const override
Definition:
DIAError.cpp:14
DIAErrorCategory::name
const char * name() const noexcept override
Definition:
DIAError.cpp:13
llvm::pdb::DIAErrCategory
const std::error_category & DIAErrCategory()
Definition:
DIAError.cpp:35
DIAErrorCategory
Definition:
DIAError.cpp:11
error_category
static ManagedStatic< _object_error_category > error_category
Definition:
Error.cpp:76
DIAError.h
Generated on Fri Mar 5 2021 21:42:31 for LLVM by
1.8.17