Граф коммитов

7 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar 7b1ab13438 utils/ABITest: Factor out type naming code slightly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 20:13:24 +00:00
Douglas Gregor aa74a1e49f 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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 20:10:50 +00:00
Daniel Dunbar 122ed24b4f Add to the house of cards that is ABITestGen.
- Support generating structures with bit-fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 23:19:55 +00:00
Daniel Dunbar 05104aa7b6 Note some more things to integrate into ABITest
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 23:12:22 +00:00
Daniel Dunbar 550faa3a6b ABITestGen: Add generation of vector types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 19:05:20 +00:00
Daniel Dunbar 6da02c6ad8 Add simple make based harness for running ABI tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62916 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 08:43:22 +00:00
Daniel Dunbar a83fb8647b Add utils/ABITest, my ABI test generation tool.
- Mostly written as an entertaining exercise in enumerating large or
   (countably, naturally) infinite sets. But hey, its useful too!

 - Idea is to number all C-types so that the N-th type can quickly be
   computed, with a good deal of flexibility about what types to
   include, and taking some care so that the (N+1)-th type is
   interestingly different from the N-th type. For example, using the
   default generator, the 1,000,000-th function type is:
--
typedef _Complex int T0;
typedef char T1 __attribute__ ((vector_size (4)));
typedef int T2 __attribute__ ((vector_size (4)));
T2 fn1000000(T0 arg0, signed long long arg1, T1 arg2, T0 arg3);
--
   and the 1,000,001-th type is:
--
typedef _Complex char T0;
typedef _Complex char T2;
typedef struct T1 { T2 field0; T2 field1; T2 field2; } T1;
typedef struct T3 {  } T3;
unsigned short fn1000001(T0 arg0, T1 arg1, T3 arg2);
--

   Computing the 10^1600-th type takes a little less than 1s. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 04:24:17 +00:00