LLVM  8.0.1
CodeViewError.cpp
Go to the documentation of this file.
1 //===- CodeViewError.cpp - Error extensions for CodeView --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
13 
14 using namespace llvm;
15 using namespace llvm::codeview;
16 
17 // FIXME: This class is only here to support the transition to llvm::Error. It
18 // will be removed once this transition is complete. Clients should prefer to
19 // deal with the Error value directly, rather than converting to error_code.
21 public:
22  const char *name() const noexcept override { return "llvm.codeview"; }
23  std::string message(int Condition) const override {
24  switch (static_cast<cv_error_code>(Condition)) {
26  return "An unknown CodeView error has occurred.";
28  return "The buffer is not large enough to read the requested number of "
29  "bytes.";
31  return "The CodeView record is corrupted.";
33  return "There are no records.";
35  return "The requested operation is not supported.";
37  return "The member record is of an unknown type.";
38  }
39  llvm_unreachable("Unrecognized cv_error_code");
40  }
41 };
42 
45  return *CodeViewErrCategory;
46 }
47 
This class represents lattice values for constants.
Definition: AllocatorList.h:24
std::string message(int Condition) const override
const char * name() const noexcept override
const std::error_category & CVErrorCategory()
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.
static llvm::ManagedStatic< CodeViewErrorCategory > CodeViewErrCategory
aarch64 promote const
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
Definition: ManagedStatic.h:61