diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-08-22 08:08:05 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-08-22 08:08:05 +0000 |
commit | 36162014c4697c30af588197d7cdeb8d2930abbf (patch) | |
tree | 48d8af920c8b27c9d20c12400ae1eb62c4ff830f /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | ae34ed2c0d2fba36d8363ba7fffc1dbe18878335 (diff) | |
download | bcm5719-llvm-36162014c4697c30af588197d7cdeb8d2930abbf.tar.gz bcm5719-llvm-36162014c4697c30af588197d7cdeb8d2930abbf.zip |
[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
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 620be4e5586..10af1a35872 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -307,9 +307,7 @@ public: break; default: - error.SetErrorStringWithFormat("invalid short option character '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; } @@ -538,9 +536,7 @@ protected: break; default: - error.SetErrorStringWithFormat("invalid short option character '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; } @@ -688,9 +684,7 @@ public: } break; default: - error.SetErrorStringWithFormat("invalid short option character '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; } @@ -775,9 +769,7 @@ public: break; default: - error.SetErrorStringWithFormat("invalid short option character '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; } @@ -896,9 +888,7 @@ public: install_path.SetFile(option_arg, FileSpec::Style::native); break; default: - error.SetErrorStringWithFormat("invalid short option character '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; } @@ -1277,9 +1267,7 @@ public: pass = option_arg; break; default: - error.SetErrorStringWithFormat("invalid short option character '%c'", - short_option); - break; + llvm_unreachable("Unimplemented option"); } return error; } |