forked from OSchip/llvm-project
95c003b96f
Summary: Testing the value of type_code against the closed enum TypeCodes provides statically verifiable completeness of testing. However, one branch assigns to type_code by casting directly from a masked integer value. This is currently handled by adding a default: case after checking each TypeCodes instance. This patch introduces a bool variable containing the "default" state value, allowing the switch to be exhaustive, protect against future instances not being handled in the switch, and preserves the original logic. This addresses the warning: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default] As an issue of maintainability, the bitmask on line 524 handles the current values of TypeCodes enum, but this will be invalid if the enum is extended. This patch does not address this, and a more closed conversion from cfinfoa -> TypeCodes would help protect against this. Reviewers: spyffe, lhames, sas Reviewed By: sas Subscribers: sas, lldb-commits Differential Revision: https://reviews.llvm.org/D35036 llvm-svn: 307712 |
||
---|---|---|
.. | ||
cmake | ||
docs | ||
examples | ||
include/lldb | ||
lit | ||
lldb.xcodeproj | ||
lldb.xcworkspace | ||
packages/Python/lldbsuite | ||
resources | ||
scripts | ||
source | ||
test | ||
third_party/Python/module | ||
tools | ||
unittests | ||
utils | ||
www | ||
.arcconfig | ||
.clang-format | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.txt | ||
INSTALL.txt | ||
LICENSE.TXT | ||
use_lldb_suite_root.py |