diff options
author | Reid Kleckner <rnk@google.com> | 2017-03-13 22:33:04 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-03-13 22:33:04 +0000 |
commit | 1f55d69227a944876e79df494bddd6a0385b5109 (patch) | |
tree | 5bb80b01577ab72815e7a612ffe77672ceee8c57 /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | fed8b570b7c50f1c36e4252dac60fe4a12f64045 (diff) | |
download | bcm5719-llvm-1f55d69227a944876e79df494bddd6a0385b5109.tar.gz bcm5719-llvm-1f55d69227a944876e79df494bddd6a0385b5109.zip |
Widen AST bitfields too small to represent all enumerators
All of these were found by a new warning that I am prototyping,
-Wbitfield-enum-conversion.
Stmt::ExprBits::ObjectKind - This was not wide enough to represent
OK_ObjSubscript, so this was a real, true positive bug.
ObjCDeclSpec::objCDeclQualifier - On Windows, setting DQ_CSNullability
would cause the bitfield to become negative because enum types are
always implicitly 'int' there. This would probably never be noticed
because this is a flag-style enum, so we only ever test one bit at a
time. Switching to 'unsigned' also makes this type pack smaller on
Windows.
FunctionDecl::SClass - Technically, we only need two bits for all valid
function storage classes. Functions can never have automatic or register
storage class. This seems a bit too clever, and we have a bit to spare,
so widening the bitfield seems like the best way to pacify the warning.
You could classify this as a false positive, but widening the bitfield
defends us from invalid ASTs.
llvm-svn: 297680
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
0 files changed, 0 insertions, 0 deletions