Commit Graph

34597 Commits

Author SHA1 Message Date
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
Bill Wendling 764b90ad4e Submitted by: Bill Wendling
- Revert use of -parse-ast-check.

llvm-svn: 39695
2007-06-27 18:13:04 +00:00
Chris Lattner 69e70e506a fix codegen of void return functions
llvm-svn: 39694
2007-06-27 18:10:00 +00:00
Chris Lattner c8c3dadaa0 fix codegen of void-returning functions
llvm-svn: 39693
2007-06-27 18:08:49 +00:00
Chris Lattner c2d8163bcd tersify output
llvm-svn: 39692
2007-06-27 17:26:23 +00:00
Chris Lattner 76148a9ded add diag checker to xcode proj
llvm-svn: 39691
2007-06-27 17:25:13 +00:00
Chris Lattner a092b149bf rename LLVMDiagChecker.* -> DiagChecker.*
llvm-svn: 39690
2007-06-27 17:24:55 +00:00
Bill Wendling a5b3bb11df Submitted by: Bill Wendling
- Chris noticed that if there were multiple warnings/errors expected
  throughout the file and we were checking only one of them, then it
  would go ahead and say that the whole file was okay. Fixed this by
  adding a check for the line number as well as the string.

llvm-svn: 39689
2007-06-27 07:43:27 +00:00
Bill Wendling 87e46687d9 Submitted by: Bill Wendling
Reviewed by: Chris Lattner

Split up lines to have only one expected output per line. Restored some
checks.

llvm-svn: 39688
2007-06-27 07:31:17 +00:00
Bill Wendling fdddfc115e Submitted by: Bill Wendling
Reviewed by: Chris Lattner

- Reverted some checks because they're checking the preprocessor output.

llvm-svn: 39687
2007-06-27 07:26:41 +00:00
Bill Wendling 52b0a4e84e Submitted by: Bill Wendling
Removed unnecessary typedef.

llvm-svn: 39686
2007-06-27 07:24:11 +00:00
Chris Lattner 9b3b9a1922 add a method to get more precise arrow positioning for expressions. Rename
some ivars to more obvious names, eliminating some comments.

llvm-svn: 39685
2007-06-27 06:08:24 +00:00
Chris Lattner a44d116835 implement the rest of Expr::hasLocalSideEffect
llvm-svn: 39684
2007-06-27 05:58:59 +00:00
Chris Lattner c4c8e2546b New testcase for unused expression analysis
llvm-svn: 39683
2007-06-27 05:58:33 +00:00