LLVM
13.0.0git
lib
DebugInfo
PDB
Native
RawError.cpp
Go to the documentation of this file.
1
#include "
llvm/DebugInfo/PDB/Native/RawError.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
namespace
{
9
// FIXME: This class is only here to support the transition to llvm::Error. It
10
// will be removed once this transition is complete. Clients should prefer to
11
// deal with the Error value directly, rather than converting to error_code.
12
class
RawErrorCategory :
public
std::error_category
{
13
public
:
14
const
char
*
name
()
const
noexcept
override
{
return
"llvm.pdb.raw"
; }
15
std::string
message
(
int
Condition)
const override
{
16
switch
(
static_cast<
raw_error_code
>
(Condition)) {
17
case
raw_error_code::unspecified
:
18
return
"An unknown error has occurred."
;
19
case
raw_error_code::feature_unsupported
:
20
return
"The feature is unsupported by the implementation."
;
21
case
raw_error_code::invalid_format
:
22
return
"The record is in an unexpected format."
;
23
case
raw_error_code::corrupt_file
:
24
return
"The PDB file is corrupt."
;
25
case
raw_error_code::insufficient_buffer
:
26
return
"The buffer is not large enough to read the requested number of "
27
"bytes."
;
28
case
raw_error_code::no_stream
:
29
return
"The specified stream could not be loaded."
;
30
case
raw_error_code::index_out_of_bounds
:
31
return
"The specified item does not exist in the array."
;
32
case
raw_error_code::invalid_block_address
:
33
return
"The specified block address is not valid."
;
34
case
raw_error_code::duplicate_entry
:
35
return
"The entry already exists."
;
36
case
raw_error_code::no_entry
:
37
return
"The entry does not exist."
;
38
case
raw_error_code::not_writable
:
39
return
"The PDB does not support writing."
;
40
case
raw_error_code::stream_too_long
:
41
return
"The stream was longer than expected."
;
42
case
raw_error_code::invalid_tpi_hash
:
43
return
"The Type record has an invalid hash value."
;
44
}
45
llvm_unreachable
(
"Unrecognized raw_error_code"
);
46
}
47
};
48
}
// namespace
49
50
static
llvm::ManagedStatic<RawErrorCategory>
RawCategory
;
51
const
std::error_category
&
llvm::pdb::RawErrCategory
() {
return
*
RawCategory
; }
52
53
char
RawError::ID
;
llvm::pdb::raw_error_code::no_stream
@ no_stream
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:23
llvm::pdb::RawErrCategory
const std::error_category & RawErrCategory()
Definition:
RawError.cpp:51
ErrorHandling.h
ManagedStatic.h
llvm::pdb::raw_error_code::index_out_of_bounds
@ index_out_of_bounds
llvm::pdb::raw_error_code::invalid_format
@ invalid_format
RawError.h
llvm::pdb::raw_error_code
raw_error_code
Definition:
RawError.h:18
llvm::pdb::raw_error_code::corrupt_file
@ corrupt_file
llvm::pdb::raw_error_code::unspecified
@ unspecified
llvm::pdb::raw_error_code::invalid_block_address
@ invalid_block_address
llvm::ManagedStatic
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
Definition:
ManagedStatic.h:83
llvm::pdb
Definition:
ConcreteSymbolEnumerator.h:20
llvm::pdb::RawError::ID
static char ID
Definition:
RawError.h:54
const
aarch64 promote const
Definition:
AArch64PromoteConstant.cpp:232
message
message(STATUS "Targeting ${t}") add_subdirectory($
Definition:
CMakeLists.txt:31
llvm::pdb::raw_error_code::feature_unsupported
@ feature_unsupported
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:
ErrorHandling.h:136
name
static const char * name
Definition:
SVEIntrinsicOpts.cpp:91
llvm::pdb::raw_error_code::not_writable
@ not_writable
llvm::pdb::raw_error_code::invalid_tpi_hash
@ invalid_tpi_hash
llvm::pdb::raw_error_code::insufficient_buffer
@ insufficient_buffer
llvm::pdb::raw_error_code::no_entry
@ no_entry
RawCategory
static llvm::ManagedStatic< RawErrorCategory > RawCategory
Definition:
RawError.cpp:50
llvm::pdb::raw_error_code::stream_too_long
@ stream_too_long
llvm::pdb::raw_error_code::duplicate_entry
@ duplicate_entry
error_category
static ManagedStatic< _object_error_category > error_category
Definition:
Error.cpp:76
Generated on Fri Mar 5 2021 21:42:32 for LLVM by
1.8.17