Skip to content

Commit 1446721

Browse files
committed
[TextAPI] Add error code for invalid input formats (llvm#71824)
(cherry picked from commit d8a4011)
1 parent fed2e87 commit 1446721

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

llvm/include/llvm/TextAPI/TextAPIError.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ enum class TextAPIErrorCode {
2121
NoSuchArchitecture,
2222
EmptyResults,
2323
GenericFrontendError,
24+
InvalidInputFormat
2425
};
2526

2627
class TextAPIError : public llvm::ErrorInfo<TextAPIError> {

llvm/lib/TextAPI/TextAPIError.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ void TextAPIError::log(raw_ostream &OS) const {
2323
case TextAPIErrorCode::NoSuchArchitecture:
2424
OS << "no such architecture\n";
2525
return;
26+
case TextAPIErrorCode::InvalidInputFormat:
27+
OS << "invalid input format\n";
28+
return;
2629
default:
2730
llvm_unreachable("unhandled TextAPIErrorCode");
2831
}

0 commit comments

Comments
 (0)