Commit Graph

34710 Commits

Author SHA1 Message Date
Chris Lattner e399420b51 Fix a release build of clang.
llvm-svn: 39756
2007-07-11 21:50:45 +00:00
Owen Anderson 1441470be8 Add support for eliminate stores to stack-allocated memory locations at the end
of a function.

llvm-svn: 39754
2007-07-11 21:06:56 +00:00
Owen Anderson e720144837 Handle eliminating stores that occur right before a free.
llvm-svn: 39753
2007-07-11 20:38:34 +00:00
Lauro Ramos Venancio 3d70855dd2 Handle packed structs in the CBackend.
llvm-svn: 39752
2007-07-11 19:56:53 +00:00
Anton Korobeynikov d9625399fb Emit correct linkage. Patch by Roman Samoilov.
llvm-svn: 39751
2007-07-11 19:51:06 +00:00
Evan Cheng ade8183fe8 Add test case for PR1545.
llvm-svn: 39749
2007-07-11 19:29:05 +00:00
Evan Cheng 6b6d1f685f Missed a couple of places where new instructions are added due to spill / restore.
llvm-svn: 39748
2007-07-11 19:17:18 +00:00
Owen Anderson bf971aafb6 Clean up a few things based on Chris' feedback.
llvm-svn: 39747
2007-07-11 19:03:09 +00:00
Chris Lattner 49ec4b6eba update this.
llvm-svn: 39746
2007-07-11 18:58:19 +00:00
Tanya Lattner ccecbcd779 Adding ability to demote phi to stack.
llvm-svn: 39744
2007-07-11 18:41:34 +00:00
Dale Johannesen e59411d056 Fix hang compiling TimberWolf (allow for islands
of size other than 4).

llvm-svn: 39743
2007-07-11 18:32:38 +00:00
Chris Lattner 28404cf449 Test commit
llvm-svn: 39738
2007-07-11 17:31:59 +00:00
Lauro Ramos Venancio 09d73c0305 Assert when TLS is not implemented.
llvm-svn: 39737
2007-07-11 17:19:51 +00:00
Duncan Sands 03b274911f Exception handling has been implemented.
llvm-svn: 39732
2007-07-11 16:59:20 +00:00
Chris Lattner 63e92754d0 Convert .cvsignore files
llvm-svn: 39731
2007-07-11 06:43:45 +00:00
Steve Naroff 68b52f6df7 Bug #:
Submitted by:
Reviewed by:
Remove reference to Attr.h...

llvm-svn: 39730
2007-07-11 00:45:07 +00:00
Steve Naroff b207d6bed7 Bug #:
Submitted by:
Reviewed by:
Removed Attr.[h,cpp]...they didn't have any useful content.

When more (GCC) attributes are added, we might want to create a file
of this ilk. For now, it's better to remove them (to eliminate any confusion).

I also update the Xcode project file...

llvm-svn: 39729
2007-07-11 00:42:37 +00:00
Steve Naroff e728ba3504 Bug #:
Submitted by:
Reviewed by:
Two vector fixes:

- Sema::CheckAssignmentConstraints() needs to compare the canonical type.
- Expr::isLvalue() needs to disallow subscripting into a vector returned by a function. This
follows the rules for struct returns (in C, at least...C++ is another story:-)

Here is an example...

float4 float4_return()
{
    float4 xx;

    return xx;
}
void add_float4_void_return(float4 *a, float4 *b, float4 *result)
{
    float f;
    float4_return()[1] = f; // now illegal
}

llvm-svn: 39728
2007-07-10 22:20:04 +00:00
Chris Lattner c14236b8ae implement codegen support for the "default argument promotions" (C99 6.5.2.2p6).
Not having this prevented promoting float arguments to double when passed
into printf, for example.

llvm-svn: 39727
2007-07-10 22:18:37 +00:00
Chris Lattner 11eef2eb9c remove obsolete comment.
llvm-svn: 39726
2007-07-10 22:18:03 +00:00
Chris Lattner a779b3df28 implement codegen support for rvalue-only vector subscripts, such as:
float4 test(void);
float test2() {
  return test()[1];
}

llvm-svn: 39725
2007-07-10 21:58:36 +00:00
Chris Lattner 08c4b9ffec Add support for codegen'ing vector subscripts, at least when they are lvalues.
llvm-svn: 39724
2007-07-10 21:17:59 +00:00
Steve Naroff b29cdd543f Bug #:
Submitted by:
Reviewed by:
Support the following...

1. Type checking and codegen support for V[i] on vectors. Hacked
Sema::ParseArraySubscriptExpr().

2. Unary bitwise complement ("~") on vectors. Hacked Sema::ParseUnaryOp().

llvm-svn: 39723
2007-07-10 18:23:31 +00:00
Chris Lattner 436806ad05 In code like this:
typedef float float4 __attribute__((vector_size (16)));
void addFloat4(float4 a, float4 b) {
    float4 temp;
}

make sure to add 'temp' to the stmt tree as a declstmt.

llvm-svn: 39722
2007-07-10 05:03:31 +00:00
Chris Lattner 50d4abd24c Add support for vector formal arguments.
llvm-svn: 39721
2007-07-10 00:28:12 +00:00
Chris Lattner 6eea886b9e implement support for llvm codegen of vectors. That was much easier than
I expected :)

llvm-svn: 39720
2007-07-10 00:23:39 +00:00
Steve Naroff 97b9e91eb7 Bug #:
Submitted by:
Reviewed by:
Added primitive support for 32-bit floating point literals.

llvm-svn: 39719
2007-07-09 23:53:58 +00:00
Chris Lattner 2ada32ed7d implement codegen support for FP literals
llvm-svn: 39718
2007-07-09 23:03:16 +00:00
Steve Naroff 84ff4b44b0 Bug #:
Submitted by:
Reviewed by:
Typechecking support for vectors...

- Added CheckVectorOperands(). Called from CheckAdditionOperands,
CheckMultiplyDivideOperands, CheckSubstractionOperands, and CheckBitwiseOperands.
- Added diagnostic for converting vector values of different size.
- Modified Type::isArithmeticType to include vectors.

Sould be ready for Chris to add code generation. I will continue testing/refining.

llvm-svn: 39717
2007-07-09 21:31:10 +00:00
Steve Naroff 4dddb6194b Bug #:
Submitted by:
Reviewed by:
Fix a bozo bug in HandleDeclAttribute...only install a new type when appropriate.
Also changed setType/setUnderlyingType to return void.

llvm-svn: 39716
2007-07-09 18:55:26 +00:00
Steve Naroff 4ae0ac6a06 Bug #:
Submitted by:
Reviewed by:
- Finished semantic analysis for vectors, added some diagnostics.
- Added AST for vectors (instantiation, installation into the decl).
- Fixed bug in ParseArraySubscriptExpr()...this crasher was introduced by me
when we added the range support.
- Turned pedantic off by default. Since vectors are gcc extensions, having
pedantic on by default was annoying. Turning it off by default is  also
consistent with gcc (but this wasn't my primary motivation).
- Tweaked some comments and diagnostics.

Note: The type checking code is still under construction (for vectors). This
will be my next check-in.

llvm-svn: 39715
2007-07-06 23:09:18 +00:00
Bill Wendling a69300375b Submitted by: Bill Wendling
Reviewed by: Chris Lattner

- Fix for C++ casting operators failing during parsing. Deriving the C++ cast
  expressions from CastExpr was the wrong way to go. Its constructor creates
  null QualTypes in one of its constructors. This doesn't work well with how
  the C++ casting expression class wanted to do things. Derive just from Expr
  instead.

llvm-svn: 39714
2007-06-29 18:21:34 +00:00
Chris Lattner 47c247e7bf add codegen support for <<= and >>=.
llvm-svn: 39713
2007-06-29 17:26:27 +00:00
Chris Lattner b25a94383a Implement the rest of the compound assignment operators, except shifts.
llvm-svn: 39712
2007-06-29 17:03:06 +00:00
Chris Lattner cd215f00ee refactor some code, implement -=
llvm-svn: 39711
2007-06-29 16:52:55 +00:00
Chris Lattner 9369a563b4 Rename ArithAssignBinaryOperator -> CompoundAssignOperator, implement
codegen support for +=.

llvm-svn: 39710
2007-06-29 16:31:29 +00:00
Bill Wendling 772996ab44 Submitted by: Bill Wendling
- The && at the end was causing this to fail. Removed.

llvm-svn: 39709
2007-06-29 09:54:25 +00:00
Chris Lattner bdf3f73eeb fix this test to work with the checker.
llvm-svn: 39708
2007-06-28 05:49:50 +00:00
Chris Lattner 11f49640ef Clients should only get read-only access to diagnostic info.
llvm-svn: 39707
2007-06-28 05:18:35 +00:00
Chris Lattner 318a9d7663 pick more logical names for routines.
llvm-svn: 39706
2007-06-28 05:17:33 +00:00
Chris Lattner 0d21046a7e Remove dead code.
llvm-svn: 39705
2007-06-28 05:10:07 +00:00
Chris Lattner 23e6353835 Eliminate almost all of the redundancy Bill introduced.
llvm-svn: 39704
2007-06-28 04:54:17 +00:00
Chris Lattner 08f0e0a001 add an accessor
llvm-svn: 39703
2007-06-28 04:53:50 +00:00
Chris Lattner ea035b5fb8 remove diagchecker.h, add more missing files.
llvm-svn: 39702
2007-06-28 04:42:53 +00:00
Chris Lattner af74985d71 Add a hack to fix a really subtle memory lifetime bug Bill introduced with his
recent changes.  carbon.h now preprocesses just fine.

llvm-svn: 39701
2007-06-28 04:10:04 +00:00
Chris Lattner 256c21b78a Record the intermediate computation type for compound assignments in the AST.
For example, for:

int test(short S, long L) {
  return S /= L;
}

record that the division is done as a long, even though the result type is
short.

llvm-svn: 39700
2007-06-28 03:53:10 +00:00
Bill Wendling 81217d6ff6 Submitted by: Bill Wendling
Update with -parse-ast-check.

llvm-svn: 39699
2007-06-28 00:54:14 +00:00
Bill Wendling f476d025f8 Submitted by: Bill Wendling
Missing support for LLVM casting operators.

llvm-svn: 39698
2007-06-28 00:46:14 +00:00
Bill Wendling 5c9dde08e7 Submitted by: Bill Wendling
Small cleanup. No need to assign to a variable before returning.

llvm-svn: 39697
2007-06-28 00:45:30 +00:00
Bill Wendling 52b4b73442 Submitted by: Bill Wendling
Fixed checking to coincide with the correct lines.

llvm-svn: 39696
2007-06-27 18:18:03 +00:00