[TextAPI] Add error code for invalid input formats (#71824)

This commit is contained in:
Cyndy Ishida
2023-11-09 13:17:41 -08:00
committed by GitHub
parent 8b98d5b813
commit d8a4011f5b
2 changed files with 4 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ enum class TextAPIErrorCode {
NoSuchArchitecture,
EmptyResults,
GenericFrontendError,
InvalidInputFormat
};
class TextAPIError : public llvm::ErrorInfo<TextAPIError> {

View File

@@ -23,6 +23,9 @@ void TextAPIError::log(raw_ostream &OS) const {
case TextAPIErrorCode::NoSuchArchitecture:
OS << "no such architecture\n";
return;
case TextAPIErrorCode::InvalidInputFormat:
OS << "invalid input format\n";
return;
default:
llvm_unreachable("unhandled TextAPIErrorCode");
}