[llvm] [TextAPI] Add error code for invalid input formats (PR #71824)
Cyndy Ishida via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 9 08:40:21 PST 2023
https://github.com/cyndyishida created https://github.com/llvm/llvm-project/pull/71824
None
>From 513244518e07ceca453dd0524a0240d6844c0519 Mon Sep 17 00:00:00 2001
From: Cyndy Ishida <cyndy_ishida at apple.com>
Date: Tue, 17 Oct 2023 08:13:06 -0700
Subject: [PATCH] [TextAPI] Add error code for invalid input formats
---
llvm/include/llvm/TextAPI/TextAPIError.h | 1 +
llvm/lib/TextAPI/TextAPIError.cpp | 3 +++
2 files changed, 4 insertions(+)
diff --git a/llvm/include/llvm/TextAPI/TextAPIError.h b/llvm/include/llvm/TextAPI/TextAPIError.h
index 566890db4b89a8d..a8484063d7948de 100644
--- a/llvm/include/llvm/TextAPI/TextAPIError.h
+++ b/llvm/include/llvm/TextAPI/TextAPIError.h
@@ -21,6 +21,7 @@ enum class TextAPIErrorCode {
NoSuchArchitecture,
EmptyResults,
GenericFrontendError,
+ InvalidInputFormat
};
class TextAPIError : public llvm::ErrorInfo<TextAPIError> {
diff --git a/llvm/lib/TextAPI/TextAPIError.cpp b/llvm/lib/TextAPI/TextAPIError.cpp
index 07eae7ab4100bcb..dd97381ce094c2f 100644
--- a/llvm/lib/TextAPI/TextAPIError.cpp
+++ b/llvm/lib/TextAPI/TextAPIError.cpp
@@ -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");
}
More information about the llvm-commits
mailing list