]> granicus.if.org Git - clang/log
clang
17 years agoUse the correct method for getting the ReferenceType from a QualType.
Bill Wendling [Tue, 17 Jul 2007 05:09:22 +0000 (05:09 +0000)]
Use the correct method for getting the ReferenceType from a QualType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39960 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoI forgot to check this in earlier
Chris Lattner [Tue, 17 Jul 2007 04:58:06 +0000 (04:58 +0000)]
I forgot to check this in earlier

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39958 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoReturn the correct type from isReferenceType().
Bill Wendling [Tue, 17 Jul 2007 04:47:36 +0000 (04:47 +0000)]
Return the correct type from isReferenceType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39956 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoChange dyn_cast for reference types to be more like pointers and not need the canonic...
Bill Wendling [Tue, 17 Jul 2007 04:16:47 +0000 (04:16 +0000)]
Change dyn_cast for reference types to be more like pointers and not need the canonical type. Also fix so that we're not expecting a return value from a void function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39954 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix references:
Bill Wendling [Tue, 17 Jul 2007 03:52:31 +0000 (03:52 +0000)]
Fix references:
    According to the spec (C++ 5p6[expr]), we need to adjust "T&" to
    "T" before further analysis. We do this via the "implicit cast"
    thingy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39953 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoConvert UsualArithmeticConversions to return "void". Now that we synthesize ImplicitC...
Steve Naroff [Tue, 17 Jul 2007 00:58:39 +0000 (00:58 +0000)]
Convert UsualArithmeticConversions to return "void". Now that we synthesize ImplicitCastExpr's,
there is no compelling need to return the converted type. If both expression type's are arithmetic, then
both types will always be the same. If they aren't (for pointer/int types, say), then the
types will be different. The client is responsible for distinguishing...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39947 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement semantic analysis for the cast operator.
Steve Naroff [Mon, 16 Jul 2007 23:25:18 +0000 (23:25 +0000)]
Implement semantic analysis for the cast operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39943 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove the 2 QualType references to method UsualArithmeticConversions. Last week...
Steve Naroff [Mon, 16 Jul 2007 22:23:01 +0000 (22:23 +0000)]
Remove the 2 QualType references to method UsualArithmeticConversions. Last week, I added these
to quickly fix a regression. Avoiding them entirely is a much cleaner solution. Clients of
UsualArithmeticConversions should simply call getType() on the expression to get the
converted type. In practice, only a small number of routines care about this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39934 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIn the final step for preserving typedef info better in the AST, upgrade
Chris Lattner [Mon, 16 Jul 2007 22:05:22 +0000 (22:05 +0000)]
In the final step for preserving typedef info better in the AST, upgrade
isPointerType and isVectorType to only look through a single level of typedef
when one is present.  For this invalid code:

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

we now get:

t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
    result[i] = a;
    ~~~~~~~~~ ^ ~

instead of:

t.c:5:15: error: incompatible types assigning 'float4' to 'int  __attribute__((vector_size(16)))'
    result[i] = a;
    ~~~~~~~~~ ^ ~

The rest of the type predicates should be upgraded to do the same thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39932 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoChange DefaultFunctionArrayConversions and UsualUnaryConversions to return void....
Steve Naroff [Mon, 16 Jul 2007 21:54:35 +0000 (21:54 +0000)]
Change DefaultFunctionArrayConversions and UsualUnaryConversions to return void. The caller
needs to query the expression for the type. Since both these functions guarantee the expression
contains a valid type, removed old/vacuous asserts (from code calling both of these routines).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39930 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a GCC warning:
Chris Lattner [Mon, 16 Jul 2007 21:39:03 +0000 (21:39 +0000)]
Fix a GCC warning:
SemaExpr.cpp:561: warning: dereferencing type-punned pointer will break strict-aliasing rules

Patch by Benoit Boissinot!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39928 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement break and continue. Patch by Anders Carlsson!
Chris Lattner [Mon, 16 Jul 2007 21:28:45 +0000 (21:28 +0000)]
Implement break and continue.  Patch by Anders Carlsson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39927 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoavoid requiring people to update from llvm svn.
Chris Lattner [Mon, 16 Jul 2007 21:04:56 +0000 (21:04 +0000)]
avoid requiring people to update from llvm svn.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39925 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoConstify the is*Lvalue() methods.
Bill Wendling [Mon, 16 Jul 2007 07:07:56 +0000 (07:07 +0000)]
Constify the is*Lvalue() methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39907 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake octal constant lexing use AdvanceToTokenCharacter to give more
Chris Lattner [Mon, 16 Jul 2007 06:55:01 +0000 (06:55 +0000)]
Make octal constant lexing use AdvanceToTokenCharacter to give more
accurate diagnostics.  For test/Lexer/comments.c we now emit:

int x = 000000080;  /* expected-error {{invalid digit}} */
               ^
constants.c:7:4: error: invalid digit '8' in octal constant
00080;             /* expected-error {{invalid digit}} */
   ^

The last line is due to an escaped newline.  The full line looks like:

int y = 0000\
00080;             /* expected-error {{invalid digit}} */

Previously, we emitted:
constants.c:4:9: error: invalid digit '8' in octal constant
int x = 000000080;  /* expected-error {{invalid digit}} */
        ^
constants.c:6:9: error: invalid digit '8' in octal constant
int y = 0000\
        ^

which isn't too bad, but the new way is better for the user,
regardless of whether there is an escaped newline or not.

All the other lexer-related diagnostics should switch over
to using AdvanceToTokenCharacter where appropriate.  Help
wanted :).

This implements test/Lexer/constants.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39906 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a new Preprocessor::AdvanceToTokenCharacter method which, given a sloc
Chris Lattner [Mon, 16 Jul 2007 06:48:38 +0000 (06:48 +0000)]
Add a new Preprocessor::AdvanceToTokenCharacter method which, given a sloc
specifying the start of a token and a logical (phase 3) character number,
returns a sloc representing the input character corresponding to it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39905 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd better comments.
Chris Lattner [Mon, 16 Jul 2007 06:46:50 +0000 (06:46 +0000)]
add better comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39904 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofactor a common predicate into a static method.
Chris Lattner [Mon, 16 Jul 2007 06:16:59 +0000 (06:16 +0000)]
factor a common predicate into a static method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39903 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a hack (mirroring llvm-gcc) to pointer difference
Chris Lattner [Mon, 16 Jul 2007 05:43:05 +0000 (05:43 +0000)]
Add a hack (mirroring llvm-gcc) to pointer difference
codegen to compile:

int test(int *A, int *B) {
  return A-B;
}

into:

_test:
        movl 4(%esp), %eax
        subl 8(%esp), %eax
        sarl $2, %eax
        ret

instead of:

_test:
        movl 4(%esp), %eax
        subl 8(%esp), %eax
        movl %eax, %ecx
        sarl $31, %ecx
        shrl $30, %ecx
        addl %ecx, %eax
        sarl $2, %eax
        ret

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39902 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd required directories to the path automatically, so the user doesn't need to worry...
Chris Lattner [Mon, 16 Jul 2007 04:35:52 +0000 (04:35 +0000)]
add required directories to the path automatically, so the user doesn't need to worry about it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39901 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake check conflicts with the other default llvm target, 'make check' will come later...
Chris Lattner [Mon, 16 Jul 2007 04:30:36 +0000 (04:30 +0000)]
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

17 years ago'make check' is what more people expect.
Chris Lattner [Mon, 16 Jul 2007 04:26:57 +0000 (04:26 +0000)]
'make check' is what more people expect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39899 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDoug Gregor pointed out that _Complex actually isn't C++ at all.
Chris Lattner [Mon, 16 Jul 2007 04:22:42 +0000 (04:22 +0000)]
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

17 years agoAdd support for C++'0x keywords, patch by Doug Gregor
Chris Lattner [Mon, 16 Jul 2007 04:18:29 +0000 (04:18 +0000)]
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

17 years agoNow that isPointerType can return a pointer type, avoid stripping off typedef
Chris Lattner [Mon, 16 Jul 2007 00:23:25 +0000 (00:23 +0000)]
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

17 years agoUse the return value of isPointerType and isVectorType to significantly simplify
Chris Lattner [Mon, 16 Jul 2007 00:14:47 +0000 (00:14 +0000)]
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

17 years agoas a very useful feature, make isVectorType and isPointerType return
Chris Lattner [Mon, 16 Jul 2007 00:13:25 +0000 (00:13 +0000)]
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

17 years agorename variables to be more consistent. Always use LHS/RHS intead of T1/T2 sometimes.
Chris Lattner [Sun, 15 Jul 2007 23:59:53 +0000 (23:59 +0000)]
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

17 years agoRemove an extraneous QualType from CastExpr, it's type is always
Chris Lattner [Sun, 15 Jul 2007 23:54:50 +0000 (23:54 +0000)]
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

17 years agodon't let builtin-type handling code fall into pointer handling code
Chris Lattner [Sun, 15 Jul 2007 23:46:53 +0000 (23:46 +0000)]
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

17 years agoset the correct width for a character literal when evaluating it as an i-c-e.
Chris Lattner [Sun, 15 Jul 2007 23:32:58 +0000 (23:32 +0000)]
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

17 years agoRefactor code so that isIntegerConstantExpr has an ASTContext available.
Chris Lattner [Sun, 15 Jul 2007 23:26:56 +0000 (23:26 +0000)]
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

17 years agoremove obsolete comment.
Chris Lattner [Sun, 15 Jul 2007 06:46:25 +0000 (06:46 +0000)]
remove obsolete comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39868 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoChange SourceManager::getInstantiationLoc to take virtual locations, doing its
Chris Lattner [Sun, 15 Jul 2007 06:35:27 +0000 (06:35 +0000)]
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

17 years agoThis is the final step/commit for implementing exlicit implicit casts. Unlike the
Steve Naroff [Sun, 15 Jul 2007 02:02:06 +0000 (02:02 +0000)]
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

17 years agonon-apple targets should be like i386, not the mythical, bogus, linux target.
Chris Lattner [Sun, 15 Jul 2007 01:37:36 +0000 (01:37 +0000)]
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

17 years agoCache macro expander objects to avoid thrashing malloc in heavy expansion situations.
Chris Lattner [Sun, 15 Jul 2007 00:25:26 +0000 (00:25 +0000)]
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

17 years agoMake parser scope cache be a member of the parser instead of a global,
Chris Lattner [Sun, 15 Jul 2007 00:04:39 +0000 (00:04 +0000)]
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

17 years agoswitch function-like macros from using a vector for their arguments to an
Chris Lattner [Sat, 14 Jul 2007 22:46:43 +0000 (22:46 +0000)]
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

17 years agoswitch from using a vector to a smallvector for macro replacement tokens
Chris Lattner [Sat, 14 Jul 2007 22:15:50 +0000 (22:15 +0000)]
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

17 years agoexpose an iterator interface to getReplacementTokens instead of the datastructure...
Chris Lattner [Sat, 14 Jul 2007 22:11:41 +0000 (22:11 +0000)]
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

17 years agosplit function-like and object-like macro body parsing to make the
Chris Lattner [Sat, 14 Jul 2007 21:54:03 +0000 (21:54 +0000)]
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

17 years agoadd FIXME and un-XFAIL test
Gabor Greif [Sat, 14 Jul 2007 20:05:18 +0000 (20:05 +0000)]
add FIXME and un-XFAIL test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39858 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd missing directory
Bill Wendling [Sat, 14 Jul 2007 09:37:10 +0000 (09:37 +0000)]
Add missing directory

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39853 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoA significant refactoring of the type size stuff to also
Chris Lattner [Sat, 14 Jul 2007 01:29:45 +0000 (01:29 +0000)]
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

17 years agoImplement trivial integer initializers, like 'int X = 4;' for global
Chris Lattner [Sat, 14 Jul 2007 00:23:28 +0000 (00:23 +0000)]
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

17 years agoIn "int X,Y;", compile both X and Y.
Chris Lattner [Sat, 14 Jul 2007 00:16:50 +0000 (00:16 +0000)]
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

17 years agoadd a fixme
Chris Lattner [Sat, 14 Jul 2007 00:01:01 +0000 (00:01 +0000)]
add a fixme

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39847 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImprove char literal pretty printing, patch by Keith Bauer!
Chris Lattner [Fri, 13 Jul 2007 23:58:20 +0000 (23:58 +0000)]
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

17 years agofix type of main, use !=
Gabor Greif [Fri, 13 Jul 2007 23:40:27 +0000 (23:40 +0000)]
fix type of main, use !=

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39842 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoimplement _Complex * == and !=
Gabor Greif [Fri, 13 Jul 2007 23:33:18 +0000 (23:33 +0000)]
implement _Complex * == and !=

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39841 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMore changes related to implementing ImplicitCastExpr.
Steve Naroff [Fri, 13 Jul 2007 23:32:42 +0000 (23:32 +0000)]
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

17 years agoUse target info to decide the sizes of basic types.
Chris Lattner [Fri, 13 Jul 2007 22:27:08 +0000 (22:27 +0000)]
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

17 years agoAdd missing citation.
Chris Lattner [Fri, 13 Jul 2007 22:16:13 +0000 (22:16 +0000)]
Add missing citation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39837 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoa simple _Complex testcase
Gabor Greif [Fri, 13 Jul 2007 22:15:44 +0000 (22:15 +0000)]
a simple _Complex testcase

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39836 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMove getSize() out of type, into ASTContext, where it has target info, and
Chris Lattner [Fri, 13 Jul 2007 22:13:22 +0000 (22:13 +0000)]
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

17 years agoUnspecified type specs default to int. This fixes a crash
Chris Lattner [Fri, 13 Jul 2007 21:02:29 +0000 (21:02 +0000)]
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

17 years agoremove some extraneous spaces, no functionality change.
Chris Lattner [Fri, 13 Jul 2007 21:01:17 +0000 (21:01 +0000)]
remove some extraneous spaces, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39832 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoimplement codegen support for implicit casts.
Chris Lattner [Fri, 13 Jul 2007 20:25:53 +0000 (20:25 +0000)]
implement codegen support for implicit casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39831 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoeliminate extraneous type, add accessors.
Chris Lattner [Fri, 13 Jul 2007 20:25:36 +0000 (20:25 +0000)]
eliminate extraneous type, add accessors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39830 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCheck in these testcases.
Chris Lattner [Fri, 13 Jul 2007 20:18:44 +0000 (20:18 +0000)]
Check in these testcases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39829 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase that crashes the cfe due to implicit conversion fun
Chris Lattner [Fri, 13 Jul 2007 20:11:01 +0000 (20:11 +0000)]
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

17 years agosilence a bogus gcc warning.
Chris Lattner [Fri, 13 Jul 2007 20:07:11 +0000 (20:07 +0000)]
silence a bogus gcc warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39824 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemoved some superfluous code. The getType() method and associated
Steve Naroff [Fri, 13 Jul 2007 17:39:21 +0000 (17:39 +0000)]
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

17 years agoremove use of alloca.
Chris Lattner [Fri, 13 Jul 2007 17:10:38 +0000 (17:10 +0000)]
remove use of alloca.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39815 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd (explicit) AST support for implicit casts. This should simplify the
Steve Naroff [Fri, 13 Jul 2007 16:58:59 +0000 (16:58 +0000)]
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

17 years agocheck in the basic llvm license
Chris Lattner [Fri, 13 Jul 2007 15:47:47 +0000 (15:47 +0000)]
check in the basic llvm license

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39812 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSolaris needs an included header for alloca
Gabor Greif [Fri, 13 Jul 2007 08:21:39 +0000 (08:21 +0000)]
Solaris needs an included header for alloca

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39797 91177308-0d34-0410-b5e6-96231b3b80d8

17 years ago"Codegen for Character Literals and Conditional Operator
Chris Lattner [Fri, 13 Jul 2007 05:18:11 +0000 (05:18 +0000)]
"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

17 years agoimplement support for basic codegen of global variables with no initializers.
Chris Lattner [Fri, 13 Jul 2007 05:13:43 +0000 (05:13 +0000)]
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

17 years ago"Someone typed "PtrToInt" where they meant "IntToPtr".
Chris Lattner [Fri, 13 Jul 2007 03:25:53 +0000 (03:25 +0000)]
"Someone typed "PtrToInt" where they meant "IntToPtr".

I've added a tests/CodeGen directory, and a test for this case that
used to fail and now passes."

Patch by Keith Bauer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39794 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement codegen for + and - with pointers. Patch contributed by
Chris Lattner [Fri, 13 Jul 2007 03:05:23 +0000 (03:05 +0000)]
Implement codegen for + and - with pointers.  Patch contributed by
Keith Bauer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39793 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoWorkaround gcc 3.4.x bug
Anton Korobeynikov [Fri, 13 Jul 2007 00:48:55 +0000 (00:48 +0000)]
Workaround gcc 3.4.x bug

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39792 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTwo changes...
Steve Naroff [Thu, 12 Jul 2007 21:46:55 +0000 (21:46 +0000)]
Two changes...

- Teach all the integer/float predicates on Type about Vectors.
- Disallow bitwise compliment on float vectors. For example...

typedef float __attribute__(( vector_size(16) )) float4;

float4 float4_return()
{
    float4 xx;

    return ~xx;
}

...now emits the following diagnostic...

[administrators-powerbook59:~/llvm/tools/clang] admin% ../../Debug/bin/clang bug.c
bug.c:8:12: error: invalid argument type to unary expression 'float4'
    return ~xx;
           ^
1 diagnostic generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39791 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoupdate tests
Chris Lattner [Thu, 12 Jul 2007 16:52:08 +0000 (16:52 +0000)]
update tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39786 91177308-0d34-0410-b5e6-96231b3b80d8

17 years ago-pedantic no longer defaults to on.
Chris Lattner [Thu, 12 Jul 2007 16:49:27 +0000 (16:49 +0000)]
-pedantic no longer defaults to on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39785 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoupdate test
Chris Lattner [Thu, 12 Jul 2007 16:48:52 +0000 (16:48 +0000)]
update test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39784 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agodon't pick up random stuff in .svn directories.
Chris Lattner [Thu, 12 Jul 2007 16:46:07 +0000 (16:46 +0000)]
don't pick up random stuff in .svn directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39783 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd missing header
Gabor Greif [Thu, 12 Jul 2007 16:00:00 +0000 (16:00 +0000)]
add missing header
(needed on Solaris)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39781 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix "no newline at end of file" warnings. Patch contributed by
Chris Lattner [Thu, 12 Jul 2007 15:43:07 +0000 (15:43 +0000)]
Fix "no newline at end of file" warnings.  Patch contributed by
Benoit Boissinot!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39780 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImprove portability to compilers where <cassert> is not implicitly
Chris Lattner [Thu, 12 Jul 2007 15:32:57 +0000 (15:32 +0000)]
Improve portability to compilers where <cassert> is not implicitly
included.  Patch contributed by Benoit Boissinot!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39779 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAllow this to compile on compilers where <string>
Chris Lattner [Thu, 12 Jul 2007 15:30:49 +0000 (15:30 +0000)]
Allow this to compile on compilers where <string>
doesn't imply <cassert>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39778 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoProperly use local variable declaration inside a switch case
Anton Korobeynikov [Thu, 12 Jul 2007 15:26:50 +0000 (15:26 +0000)]
Properly use local variable declaration inside a switch case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39777 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd missing specification for a default argument. I guess g++ 4.0 doesn't
Chris Lattner [Thu, 12 Jul 2007 15:26:16 +0000 (15:26 +0000)]
add missing specification for a default argument.  I guess g++ 4.0 doesn't
notice this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39776 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoEvaluate the initializer for automatic variables.
Chris Lattner [Thu, 12 Jul 2007 00:39:48 +0000 (00:39 +0000)]
Evaluate the initializer for automatic variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39771 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoremember the initializer for a variable in the AST and teach the
Chris Lattner [Thu, 12 Jul 2007 00:36:32 +0000 (00:36 +0000)]
remember the initializer for a variable in the AST and teach the
pretty printer to print it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39770 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoimplement codegen support for pre/post inc/dec.
Chris Lattner [Wed, 11 Jul 2007 23:43:46 +0000 (23:43 +0000)]
implement codegen support for pre/post inc/dec.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39765 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a release build of clang.
Chris Lattner [Wed, 11 Jul 2007 21:50:45 +0000 (21:50 +0000)]
Fix a release build of clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39756 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoupdate this.
Chris Lattner [Wed, 11 Jul 2007 18:58:19 +0000 (18:58 +0000)]
update this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39746 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest commit
Chris Lattner [Wed, 11 Jul 2007 17:31:59 +0000 (17:31 +0000)]
Test commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39738 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMove the ModuleInfo.txt file.
Reid Spencer [Wed, 11 Jul 2007 17:03:27 +0000 (17:03 +0000)]
Move the ModuleInfo.txt file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39735 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoStage two of getting CFE top correct.
Reid Spencer [Wed, 11 Jul 2007 17:01:13 +0000 (17:01 +0000)]
Stage two of getting CFE top correct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a comment to indicate what this file is for.
Reid Spencer [Wed, 11 Jul 2007 08:00:56 +0000 (08:00 +0000)]
Add a comment to indicate what this file is for.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@38533 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd ModuleInfo.txt for the cfe module.
Reid Spencer [Wed, 11 Jul 2007 07:46:26 +0000 (07:46 +0000)]
Add ModuleInfo.txt for the cfe module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@38532 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCreate initial directory structure for the C Front End.
Reid Spencer [Wed, 11 Jul 2007 07:42:41 +0000 (07:42 +0000)]
Create initial directory structure for the C Front End.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@38531 91177308-0d34-0410-b5e6-96231b3b80d8