summaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/TextAPIError.cpp
diff options
context:
space:
mode:
authorCyndy Ishida <cyndy_ishida@apple.com>2023-11-15 09:31:31 -0800
committerGitHub <noreply@github.com>2023-11-15 09:31:31 -0800
commitec64af5994213cf7933e961a2b7fe07193a77b61 (patch)
tree16b2bce4e78b0f7606f368c22c74f3e24e9d3567 /llvm/lib/TextAPI/TextAPIError.cpp
parent14a84510f5d07b05b348188c7dfbe54076fa1485 (diff)
[readtapi] Use OptParser.td for options (#72183)
This includes revamping how --compare was handled and adds `-o` ontop of tablegen approach. This will be used to add more complex options.
Diffstat (limited to 'llvm/lib/TextAPI/TextAPIError.cpp')
-rw-r--r--llvm/lib/TextAPI/TextAPIError.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/TextAPI/TextAPIError.cpp b/llvm/lib/TextAPI/TextAPIError.cpp
index dd97381ce094..23954a9e3466 100644
--- a/llvm/lib/TextAPI/TextAPIError.cpp
+++ b/llvm/lib/TextAPI/TextAPIError.cpp
@@ -21,14 +21,17 @@ char TextAPIError::ID = 0;
void TextAPIError::log(raw_ostream &OS) const {
switch (EC) {
case TextAPIErrorCode::NoSuchArchitecture:
- OS << "no such architecture\n";
- return;
+ OS << "no such architecture";
+ break;
case TextAPIErrorCode::InvalidInputFormat:
- OS << "invalid input format\n";
- return;
+ OS << "invalid input format";
+ break;
default:
llvm_unreachable("unhandled TextAPIErrorCode");
}
+ if (!Msg.empty())
+ OS << ": " << Msg;
+ OS << "\n";
}
std::error_code TextAPIError::convertToErrorCode() const {