Commit Graph

7 Commits

Author SHA1 Message Date
John McCall deebbcf20d Undo a refactor-o and base the bitfield-truncation warning on the
uncoerced value.  Also, whitelist bool bitfields, which aren't
really a truncation.

llvm-svn: 118778
2010-11-11 05:33:51 +00:00
John McCall 1f425648ca Extend the bitfield-truncation warning to initializations.
rdar://problem/8652606

llvm-svn: 118773
2010-11-11 03:21:53 +00:00
John McCall 817d4af557 When -Wconversion computes the range of a type, it uses the (bit-)range
of the enumerators rather than the actual expressible range.  This is 
great when dealing with opaque *values* of that type, but when computing
the range of the type for purposes of converting *into* it, it produces
warnings in cases we don't care about (e.g. enum_t x = 500;).  Divide 
the logic into these two cases and use the more conservative range for
targets.    

llvm-svn: 118735
2010-11-10 23:38:19 +00:00
John McCall fd81c52947 Tweak to bitfield-overflow warning: don't warn about storing
a positive value into a signed bitfield of the exact width of
the value.

llvm-svn: 118657
2010-11-10 00:26:50 +00:00
John McCall 0e6cfaf6c0 Typo.
llvm-svn: 118649
2010-11-09 23:36:43 +00:00
John McCall d2a5312e14 Add a warning for implicit truncation of constant values due to
bitfield assignment.

Implements rdar://problem/7809123

llvm-svn: 118647
2010-11-09 23:24:47 +00:00
John McCall 18a2c2c0b9 Split out -Wconversion warnings about constant precision into their
own subcategory, -Wconstant-conversion, which is on by default.

Tweak the constant folder to give better results in the invalid
case of a negative shift amount.

Implements rdar://problem/6792488

llvm-svn: 118636
2010-11-09 22:22:12 +00:00