Files
archived-llvm-mirror/include/llvm/DebugInfo/CodeView/CodeViewError.h
Zachary Turner 493dc32ae8 [codeview] Move StreamInterface and StreamReader to libcodeview.
We have need to reuse this functionality, including making
additional generic stream types that are smarter about how and
when they copy memory versus referencing the original memory.
So all of these structures belong in the common library
rather than being pdb specific.

llvm-svn: 270751
2016-05-25 20:37:03 +00:00

44 lines
1.1 KiB
C++

//===- CodeViewError.h - Error extensions for CodeView ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_CODEVIEW_CODEVIEWERROR_H
#define LLVM_DEBUGINFO_PDB_CODEVIEW_CODEVIEWERROR_H
#include "llvm/Support/Error.h"
#include <string>
namespace llvm {
namespace codeview {
enum class cv_error_code {
unspecified = 1,
insufficient_buffer,
corrupt_record,
};
/// Base class for errors originating when parsing raw PDB files
class CodeViewError : public ErrorInfo<CodeViewError> {
public:
static char ID;
CodeViewError(cv_error_code C);
CodeViewError(const std::string &Context);
CodeViewError(cv_error_code C, const std::string &Context);
void log(raw_ostream &OS) const override;
const std::string &getErrorMessage() const;
std::error_code convertToErrorCode() const override;
private:
std::string ErrMsg;
cv_error_code Code;
};
}
}
#endif