Go to file
Chandler Carruth 4c6fdca035 Implement a warning for known shift overflows on constant shift
expressions. Consider the code:

  int64_t i = 10 << 30;

This compiles fine, but most developers expect it to produce the value
for 10 gigs, not -2 gigs. This is actually undefined behavior because
the LHS is a signed integer type.

The warning is currently gated behind -Wshift-overflow.

There is a special case where only the sign bit is overridden that gets
a custom error message and is by default ignored. This case is much less
likely to cause observed buggy behavior, it's just undefined behavior
according to the spec. This warning can be enabled with
-Wshift-sign-overflow.

Original patch by Oleg Slezberg, with style tweaks and some correctness
fixes by me.

llvm-svn: 126342
2011-02-23 23:34:11 +00:00
clang Implement a warning for known shift overflows on constant shift 2011-02-23 23:34:11 +00:00
compiler-rt clang_darwin: We don't need clear_cache for use with Clang on ARM/Darwin. 2011-01-21 18:23:47 +00:00
debuginfo-tests test case for r125249. 2011-02-10 00:41:14 +00:00
libcxx Jean-Daniel Dupas fixes install directions 2011-02-22 14:18:34 +00:00
lldb Add emulation for "ADR" operations. Add a ThumbImm8Scaled() convenience function 2011-02-23 21:24:25 +00:00
llvm Use DW_FORM_data2 for DW_AT_language and let users use DW_LANG_lo_user=0x8000 to DW_LANG_hi_user=0xffff range. 2011-02-23 22:37:04 +00:00