Path: blob/main/contrib/llvm-project/llvm/lib/DebugInfo/PDB/DIA/DIAError.cpp
35293 views
#include "llvm/DebugInfo/PDB/DIA/DIAError.h"1#include "llvm/Support/ErrorHandling.h"23using namespace llvm;4using namespace llvm::pdb;56// FIXME: This class is only here to support the transition to llvm::Error. It7// will be removed once this transition is complete. Clients should prefer to8// deal with the Error value directly, rather than converting to error_code.9class DIAErrorCategory : public std::error_category {10public:11const char *name() const noexcept override { return "llvm.pdb.dia"; }12std::string message(int Condition) const override {13switch (static_cast<dia_error_code>(Condition)) {14case dia_error_code::could_not_create_impl:15return "Failed to connect to DIA at runtime. Verify that Visual Studio "16"is properly installed, or that msdiaXX.dll is in your PATH.";17case dia_error_code::invalid_file_format:18return "Unable to load PDB. The file has an unrecognized format.";19case dia_error_code::invalid_parameter:20return "The parameter is incorrect.";21case dia_error_code::already_loaded:22return "Unable to load the PDB or EXE, because it is already loaded.";23case dia_error_code::debug_info_mismatch:24return "The PDB file and the EXE file do not match.";25case dia_error_code::unspecified:26return "An unknown error has occurred.";27}28llvm_unreachable("Unrecognized DIAErrorCode");29}30};3132const std::error_category &llvm::pdb::DIAErrCategory() {33static DIAErrorCategory DIACategory;34return DIACategory;35}3637char DIAError::ID;383940