diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/RawError.cpp | 30 |
4 files changed, 4 insertions, 30 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp index 086da13135c..bf66f1c3f42 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp @@ -11,7 +11,6 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" -#include "llvm/DebugInfo/PDB/GenericError.h" #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" #include "llvm/DebugInfo/PDB/IPDBSourceFile.h" #include "llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h" diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp index c5ce3e0091f..a1f8786ff12 100644 --- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp @@ -125,7 +125,7 @@ Error PDBFile::parseFileHeaders() { if (auto EC = Reader.readObject(SB)) { consumeError(std::move(EC)); return make_error<RawError>(raw_error_code::corrupt_file, - "Does not contain superblock"); + "MSF superblock is missing"); } if (auto EC = msf::validateSuperBlock(*SB)) diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp index e164e7cf1c5..1612d74eba2 100644 --- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp @@ -12,7 +12,6 @@ #include "llvm/ADT/BitVector.h" #include "llvm/DebugInfo/MSF/MSFBuilder.h" -#include "llvm/DebugInfo/PDB/GenericError.h" #include "llvm/DebugInfo/PDB/Native/DbiStream.h" #include "llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h" #include "llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h" diff --git a/llvm/lib/DebugInfo/PDB/Native/RawError.cpp b/llvm/lib/DebugInfo/PDB/Native/RawError.cpp index 548289fff3d..dec9797088f 100644 --- a/llvm/lib/DebugInfo/PDB/Native/RawError.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/RawError.cpp @@ -5,14 +5,12 @@ using namespace llvm; using namespace llvm::pdb; -namespace { // FIXME: This class is only here to support the transition to llvm::Error. It // will be removed once this transition is complete. Clients should prefer to // deal with the Error value directly, rather than converting to error_code. class RawErrorCategory : public std::error_category { public: const char *name() const noexcept override { return "llvm.pdb.raw"; } - std::string message(int Condition) const override { switch (static_cast<raw_error_code>(Condition)) { case raw_error_code::unspecified: @@ -46,30 +44,8 @@ public: llvm_unreachable("Unrecognized raw_error_code"); } }; -} // end anonymous namespace - -static ManagedStatic<RawErrorCategory> Category; - -char RawError::ID = 0; - -RawError::RawError(raw_error_code C) : RawError(C, "") {} - -RawError::RawError(const std::string &Context) - : RawError(raw_error_code::unspecified, Context) {} - -RawError::RawError(raw_error_code C, const std::string &Context) : Code(C) { - ErrMsg = "Native PDB Error: "; - std::error_code EC = convertToErrorCode(); - if (Code != raw_error_code::unspecified) - ErrMsg += EC.message() + " "; - if (!Context.empty()) - ErrMsg += Context; -} - -void RawError::log(raw_ostream &OS) const { OS << ErrMsg << "\n"; } -const std::string &RawError::getErrorMessage() const { return ErrMsg; } +static llvm::ManagedStatic<RawErrorCategory> RawCategory; +const std::error_category &llvm::pdb::RawErrCategory() { return *RawCategory; } -std::error_code RawError::convertToErrorCode() const { - return std::error_code(static_cast<int>(Code), *Category); -} +char RawError::ID; |