LLVM  8.0.1
RawError.cpp
Go to the documentation of this file.
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.
12 public:
13  const char *name() const noexcept override { return "llvm.pdb.raw"; }
14  std::string message(int Condition) const override {
15  switch (static_cast<raw_error_code>(Condition)) {
17  return "An unknown error has occurred.";
19  return "The feature is unsupported by the implementation.";
21  return "The record is in an unexpected format.";
23  return "The PDB file is corrupt.";
25  return "The buffer is not large enough to read the requested number of "
26  "bytes.";
28  return "The specified stream could not be loaded.";
30  return "The specified item does not exist in the array.";
32  return "The specified block address is not valid.";
34  return "The entry already exists.";
36  return "The entry does not exist.";
38  return "The PDB does not support writing.";
40  return "The stream was longer than expected.";
42  return "The Type record has an invalid hash value.";
43  }
44  llvm_unreachable("Unrecognized raw_error_code");
45  }
46 };
47 
50 
51 char RawError::ID;
This class represents lattice values for constants.
Definition: AllocatorList.h:24
const char * name() const noexcept override
Definition: RawError.cpp:13
static llvm::ManagedStatic< RawErrorCategory > RawCategory
Definition: RawError.cpp:48
std::string message(int Condition) const override
Definition: RawError.cpp:14
const std::error_category & RawErrCategory()
Definition: RawError.cpp:49
static ManagedStatic< _object_error_category > error_category
Definition: Error.cpp:75
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
aarch64 promote const
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
Definition: ManagedStatic.h:61
static char ID
Definition: RawError.h:55