]> granicus.if.org Git - clang/log
clang
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