mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Move the bitcode error enum to the include directory.
This will let users in other libraries know which error occurred. In particular, it will be possible to check if the parsing failed or if the file is not bitcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214209 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -139,6 +139,38 @@ namespace llvm {
|
||||
BufEnd = BufPtr+Size;
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::error_category &BitcodeErrorCategory();
|
||||
enum class BitcodeError {
|
||||
BitcodeStreamInvalidSize,
|
||||
ConflictingMETADATA_KINDRecords,
|
||||
CouldNotFindFunctionInStream,
|
||||
ExpectedConstant,
|
||||
InsufficientFunctionProtos,
|
||||
InvalidBitcodeSignature,
|
||||
InvalidBitcodeWrapperHeader,
|
||||
InvalidConstantReference,
|
||||
InvalidID, // A read identifier is not found in the table it should be in.
|
||||
InvalidInstructionWithNoBB,
|
||||
InvalidRecord, // A read record doesn't have the expected size or structure
|
||||
InvalidTypeForValue, // Type read OK, but is invalid for its use
|
||||
InvalidTYPETable,
|
||||
InvalidType, // We were unable to read a type
|
||||
MalformedBlock, // We are unable to advance in the stream.
|
||||
MalformedGlobalInitializerSet,
|
||||
InvalidMultipleBlocks, // We found multiple blocks of a kind that should
|
||||
// have only one
|
||||
NeverResolvedValueFoundInFunction,
|
||||
InvalidValue // Invalid version, inst number, attr number, etc
|
||||
};
|
||||
inline std::error_code make_error_code(BitcodeError E) {
|
||||
return std::error_code(static_cast<int>(E), BitcodeErrorCategory());
|
||||
}
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
namespace std {
|
||||
template <> struct is_error_code_enum<llvm::BitcodeError> : std::true_type {};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user