[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
This commit is contained in:
Raphael Isemann
2019-08-22 08:08:05 +00:00
parent ae34ed2c0d
commit 36162014c4
27 changed files with 82 additions and 217 deletions

View File

@@ -92,9 +92,7 @@ public:
} break;
default:
error.SetErrorStringWithFormat("invalid short option character '%c'",
short_option);
break;
llvm_unreachable("Unimplemented option");
}
return error;
@@ -257,9 +255,7 @@ public:
break;
default:
error.SetErrorStringWithFormat("invalid short option character '%c'",
short_option);
break;
llvm_unreachable("Unimplemented option");
}
return error;
@@ -763,9 +759,7 @@ private:
m_regex = true;
break;
default:
error.SetErrorStringWithFormat("unrecognized option '%c'",
short_option);
break;
llvm_unreachable("Unimplemented option");
}
return error;