From 36162014c4697c30af588197d7cdeb8d2930abbf Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Thu, 22 Aug 2019 08:08:05 +0000 Subject: [lldb][NFC] Remove dead code that is supposed to handle invalid command options Summary: We currently have a bunch of code that is supposed to handle invalid command options, but all this code is unreachable because invalid options are already handled in `Options::Parse`. The only way we can reach this code is when we declare but then not implement an option (which will be made impossible with D65386, which is also when we can completely remove the `default` cases). This patch replaces all this code with `llvm_unreachable` to make clear this is dead code that can't be reached. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66522 llvm-svn: 369625 --- lldb/source/Commands/CommandObjectSource.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lldb/source/Commands/CommandObjectSource.cpp') diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 417dedc..de82e25 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -82,9 +82,7 @@ class CommandObjectSourceInfo : public CommandObjectParsed { modules.push_back(std::string(option_arg)); break; default: - error.SetErrorStringWithFormat("unrecognized short option '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; @@ -683,9 +681,7 @@ class CommandObjectSourceList : public CommandObjectParsed { reverse = true; break; default: - error.SetErrorStringWithFormat("unrecognized short option '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; -- cgit v1.1