llvm-project/clang/utils
Douglas Gregor a71cc15361 Implement promotion for enumeration types.
WHAT!?!

It turns out that Type::isPromotableIntegerType() was not considering
enumeration types to be promotable, so we would never do the
promotion despite having properly computed the promotion type when the
enum was defined. Various operations on values of enum type just
"worked" because we could still compute the integer rank of an enum
type; the oddity, however, is that operations such as "add an enum and
an unsigned" would often have an enum result type (!). The bug
actually showed up as a spurious -Wformat diagnostic
(<rdar://problem/7595366>), but in theory it could cause miscompiles.

In this commit:
  - Enum types with a promotion type of "int" or "unsigned int" are
  promotable.
  - Tweaked the computation of promotable types for enums
  - For all of the ABIs, treat enum types the same way as their
  underlying types (*not* their promotion types) for argument passing
  and return values
  - Extend the ABI tester with support for enumeration types

llvm-svn: 95117
2010-02-02 20:10:50 +00:00
..
ABITest Implement promotion for enumeration types. 2010-02-02 20:10:50 +00:00
C++Tests Tests: Tweak LLVM-Code-Symbols test to ignore common and undefined symbols for 2009-12-26 22:58:48 +00:00
OptionalTests Extern darwin-clang_rt.c test to also test targetting ARM ({armv6, armv7} x 2010-01-23 00:26:38 +00:00
TestUtils Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc. 2009-12-11 23:04:35 +00:00
VtableTest Remove unused code. 2010-01-12 22:20:00 +00:00
analyzer Move ubiviz to analyzer directory 2009-12-01 06:34:06 +00:00
valgrind Add a valgrind suppressions file for x86_64-pc-linux-gnu and gcc-4.3.3 which 2009-09-04 02:53:57 +00:00
CaptureCmd Use /usr/bin/env trick to find python. Patch by Krister Walfridsson. 2009-07-10 20:15:12 +00:00
CmpDriver Also compare stdout and stderr lines. 2009-09-04 18:35:09 +00:00
FindSpecRefs Use /usr/bin/env trick to find python. Patch by Krister Walfridsson. 2009-07-10 20:15:12 +00:00
SummarizeErrors Use /usr/bin/env trick to find python. Patch by Krister Walfridsson. 2009-07-10 20:15:12 +00:00
builtin-defines.c Tweak this non-default test so it still works w/ x86 feature support. 2009-05-11 23:11:21 +00:00
clang-completion-mode.el Insert clang-flags into the clang command. Currently it needs to be a list; 2010-01-13 06:44:51 +00:00
token-delta.py Add a very primitive clang based multifile 'delta'. 2009-02-24 07:42:32 +00:00