summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectThread.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-08-22 08:08:05 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-08-22 08:08:05 +0000
commit36162014c4697c30af588197d7cdeb8d2930abbf (patch)
tree48d8af920c8b27c9d20c12400ae1eb62c4ff830f /lldb/source/Commands/CommandObjectThread.cpp
parentae34ed2c0d2fba36d8363ba7fffc1dbe18878335 (diff)
downloadbcm5719-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/CommandObjectThread.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 55d0d3fd2f6..2edba1d8da1 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -281,9 +281,7 @@ public:
"invalid boolean value for option '%c'", short_option);
} break;
default:
- error.SetErrorStringWithFormat("invalid short option character '%c'",
- short_option);
- break;
+ llvm_unreachable("Unimplemented option");
}
return error;
}
@@ -485,9 +483,7 @@ public:
break;
default:
- error.SetErrorStringWithFormat("invalid short option character '%c'",
- short_option);
- break;
+ llvm_unreachable("Unimplemented option");
}
return error;
}
@@ -1037,9 +1033,7 @@ public:
}
} break;
default:
- error.SetErrorStringWithFormat("invalid short option character '%c'",
- short_option);
- break;
+ llvm_unreachable("Unimplemented option");
}
return error;
}
@@ -1426,7 +1420,7 @@ public:
break;
default:
- return Status("invalid short option character '%c'", short_option);
+ llvm_unreachable("Unimplemented option");
}
return error;
}
@@ -1560,9 +1554,7 @@ public:
}
} break;
default:
- error.SetErrorStringWithFormat("invalid short option character '%c'",
- short_option);
- break;
+ llvm_unreachable("Unimplemented option");
}
return error;
}
@@ -1744,7 +1736,7 @@ public:
m_force = true;
break;
default:
- return Status("invalid short option character '%c'", short_option);
+ llvm_unreachable("Unimplemented option");
}
return error;
}
@@ -1866,9 +1858,7 @@ public:
m_verbose = true;
break;
default:
- error.SetErrorStringWithFormat("invalid short option character '%c'",
- short_option);
- break;
+ llvm_unreachable("Unimplemented option");
}
return error;
}
OpenPOWER on IntegriCloud