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

61275 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 7d5afc3982 Make check conflicts with the other default llvm target, 'make check' will come later I guess.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39900 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 04:30:36 +00:00
Chris Lattner 077c3f2d5c 'make check' is what more people expect.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39899 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 04:26:57 +00:00
Chris Lattner 9505581a3a Doug Gregor pointed out that _Complex actually isn't C++ at all.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 04:22:42 +00:00
Chris Lattner d4b80f1a0e Add support for C++'0x keywords, patch by Doug Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39897 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 04:18:29 +00:00
Chris Lattner 7a2e047c60 Now that isPointerType can return a pointer type, avoid stripping off typedef
information in the common case.  On this invalid code:

typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
void test(float4 a, int4 *result, int i) {
    result[i] = a;
}

we now generate:
  t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
instead of:
  t.c:5:15: error: incompatible types assigning 'float4' to 'int  __attribute__((vector_size(16)))'

This implements test/Sema/typedef-retain.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39892 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 00:23:25 +00:00
Chris Lattner 12d9ff6a07 Use the return value of isPointerType and isVectorType to significantly simplify
ParseArraySubscriptExpr.  Notably, the new code doesn't have to think about 
canonical types at all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39891 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 00:14:47 +00:00
Chris Lattner 3acb138056 as a very useful feature, make isVectorType and isPointerType return
the actual vectortype or pointertype when they return success.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 00:13:25 +00:00
Chris Lattner 727a80dda3 rename variables to be more consistent. Always use LHS/RHS intead of T1/T2 sometimes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39889 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 23:59:53 +00:00
Chris Lattner 26dc7b3926 Remove an extraneous QualType from CastExpr, it's type is always
the result type of the expr node.

Implement isIntegerConstantExpr for ImplicitCastExpr nodes the same
was as for CastExpr nodes.

Implement proper sign/zero extension as well as truncation and noop
conversion in the i-c-e evaluator.  This allows us to correctly
handle i-c-e's like these:

char array[1024/(sizeof (long))];
int x['\xBb' == (char) 187 ? 1: -1];

this implements test/Sema/i-c-e2.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39888 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 23:54:50 +00:00
Chris Lattner bfef6d7c67 don't let builtin-type handling code fall into pointer handling code
not all builtin types have size and alignment equal to pointers :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39887 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 23:46:53 +00:00
Chris Lattner 2eadfb638e set the correct width for a character literal when evaluating it as an i-c-e.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39886 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 23:32:58 +00:00
Chris Lattner 590b6646ef Refactor code so that isIntegerConstantExpr has an ASTContext available.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 23:26:56 +00:00
Chris Lattner dda75cf84c remove obsolete comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 06:46:25 +00:00
Chris Lattner abca2bba54 Change SourceManager::getInstantiationLoc to take virtual locations, doing its
virtual->physical mapping explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 06:35:27 +00:00
Steve Naroff fa2eaabd30 This is the final step/commit for implementing exlicit implicit casts. Unlike the
previous two checkins, which involved lot's of tedious refactoring, this checkin is nice and clean:-)

- Hacked UsualUnaryConversions, UsualArithmeticConversions, and DefaultFunctionArrayConversion
to create the AST node (using a helper function promoteExprToType).
- Added a setType method to Expr.
- Changed Expr::isIntegerConstantExpr to allow for the new node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 02:02:06 +00:00
Chris Lattner c3f8937483 non-apple targets should be like i386, not the mythical, bogus, linux target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 01:37:36 +00:00
Chris Lattner 9594acf32d Cache macro expander objects to avoid thrashing malloc in heavy expansion situations.
This doesn't significantly improve carbon.h, but it does speed up
INPUTS/macro_pounder_obj.c by 48%



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39864 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 00:25:26 +00:00
Chris Lattner 9e344c65b1 Make parser scope cache be a member of the parser instead of a global,
which makes it multithread clean.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39863 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15 00:04:39 +00:00
Chris Lattner 25c9648909 switch function-like macros from using a vector for their arguments to an
explicitly new'd array.  The array never mutates once created, so a vector
is overkill.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39862 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 22:46:43 +00:00
Chris Lattner f46f68b558 switch from using a vector to a smallvector for macro replacement tokens
This speeds up parsing carbon.h by 3.3% by avoiding some malloc traffic for 
small macros.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39861 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 22:15:50 +00:00
Chris Lattner c215bd659d expose an iterator interface to getReplacementTokens instead of the datastructure itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39860 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 22:11:41 +00:00
Chris Lattner b5e240fa9e split function-like and object-like macro body parsing to make the
code more obvious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 21:54:03 +00:00
Gabor Greif d5e0d9854c add FIXME and un-XFAIL test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 20:05:18 +00:00
Bill Wendling 11f2dfefc9 Add missing directory
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 09:37:10 +00:00
Chris Lattner d2d2a11a91 A significant refactoring of the type size stuff to also
compute type alignment.  This info is needed for struct layout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 01:29:45 +00:00
Chris Lattner 8f32f7189b Implement trivial integer initializers, like 'int X = 4;' for global
vars.  Approach suggested by Keith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39849 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 00:23:28 +00:00
Chris Lattner 32b266cff6 In "int X,Y;", compile both X and Y.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39848 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 00:16:50 +00:00
Chris Lattner 06c8d963bc add a fixme
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39847 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14 00:01:01 +00:00
Chris Lattner 8bf9f079f1 Improve char literal pretty printing, patch by Keith Bauer!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39846 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 23:58:20 +00:00
Gabor Greif b02d4b4bdf fix type of main, use !=
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39842 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 23:40:27 +00:00
Gabor Greif 4db18f279b implement _Complex * == and !=
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 23:33:18 +00:00
Steve Naroff 90045e8eba More changes related to implementing ImplicitCastExpr.
- Fixed a recent regression discovered by Keith Bauer (thanks!). 
The fix involved adding (back) two arguments to UsualArithmeticConversions.
Without the reference arguments, no unary conversions were being passed back
to the caller. This had the effect of turning off the UsualUnaryConversions.
- Refactored CheckAssignmentConstraints into 3 functions. CheckAssignmentConstraints,
CheckSingleAssignmentConstraints, and CheckCompoundAssignmentConstraints. 
- Changed the argument type of DefaultFunctionArrayConversion from QualType->Expr*&.
- Removed a bunch of casts in routines I was working on (cleanup).
- Fixed the visitor for ImplicitCastExpr (oops).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39840 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 23:32:42 +00:00
Chris Lattner 692233e90a Use target info to decide the sizes of basic types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39838 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 22:27:08 +00:00
Chris Lattner 7ab2ed8e88 Add missing citation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39837 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 22:16:13 +00:00
Gabor Greif bacfa02138 a simple _Complex testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39836 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 22:15:44 +00:00
Chris Lattner a7674d8a9a Move getSize() out of type, into ASTContext, where it has target info, and
where ASTContext can manage caches for struct layout, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39835 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 22:13:22 +00:00
Chris Lattner 7a543ad55a Unspecified type specs default to int. This fixes a crash
on test/Sema/implicit-int.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39833 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 21:02:29 +00:00
Chris Lattner e107b5d1b3 remove some extraneous spaces, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39832 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 21:01:17 +00:00
Chris Lattner d07eb3b5b4 implement codegen support for implicit casts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 20:25:53 +00:00
Chris Lattner d0d560a097 eliminate extraneous type, add accessors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39830 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 20:25:36 +00:00
Chris Lattner 8da1cb6339 Check in these testcases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 20:18:44 +00:00
Chris Lattner a63ff1486d new testcase that crashes the cfe due to implicit conversion fun
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39826 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 20:11:01 +00:00
Chris Lattner a80b0bafd4 silence a bogus gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 20:07:11 +00:00
Steve Naroff ba61c14bc9 Removed some superfluous code. The getType() method and associated
assert is now done in UsualUnaryConversions().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 17:39:21 +00:00
Chris Lattner c35717a1b3 remove use of alloca.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 17:10:38 +00:00
Steve Naroff 49b4526992 Add (explicit) AST support for implicit casts. This should simplify the
code generator. Source translation tools can simply ignore this node.

- Added a new Expr node, ImplicitCastExpr.
- Changed UsualUnaryConversions/UsualArithmeticConversions to take references 
to Expr *'s. This will allow these routines to instantiate the new AST node
and pass it back.
- Changed all clients of UsualUnary/UsualArithmetic (lot's of diff's).
- Changed some names in CheckConditionalOperands. Several variables where
only distinguished by their case (e.g. Cond, cond). Yuck (what was I thinking).
- Removed an old/crufty constructor in CastExpr (cleanup).

This check-in does not actually create the new AST node. I wanted to separate
the mechanical changes from the semantic changes. In addition, I need to 
coordinate with Chris, since the semantic change will break the code generator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39814 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 16:58:59 +00:00
Chris Lattner 8a6a237817 check in the basic llvm license
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39812 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 15:47:47 +00:00
Gabor Greif 7ae5326415 Solaris needs an included header for alloca
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39797 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 08:21:39 +00:00
Chris Lattner b0a721a51a "Codegen for Character Literals and Conditional Operator
Both in one patch, and the test case that Chris didn't commit last
time is in there too...

I'll split the patch up if somebody wants it split."

Patch by Keith Bauer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 05:18:11 +00:00
Chris Lattner 88a69ad80e implement support for basic codegen of global variables with no initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-13 05:13:43 +00:00