[Lldb-commits] [lldb] r258199 - [Process] Remove dead code. All the switch cases are already covered.

Joerg Sonnenberger via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 19 17:11:28 PST 2016


On Tue, Jan 19, 2016 at 10:11:48PM +0000, Zachary Turner via lldb-commits wrote:
> What about this:
> 
>     switch (m_private_state.GetValue())
>     {
>         case eStateConnected:
>         case eStateAttaching:
>         case eStateLaunching:
>         case eStateStopped:
>         case eStateRunning:
>         case eStateStepping:
>         case eStateCrashed:
>         case eStateSuspended:
>             return true;
> 
>         default:
>             return false;
>     }

The prefered form in LLVM is to have a unreachable after the switch when
it is supposed to be covered, does that work for LLVM here? E.g. do list
the case with false, but drop the default in favor of an
llvm_unreachable after the switch.

Joerg


More information about the lldb-commits mailing list