Commit Graph

35947 Commits

Author SHA1 Message Date
Chris Lattner b633469e02 compound assignment operators are of type CompoundAssignOperator
llvm-svn: 41460
2007-08-26 21:41:21 +00:00
Chris Lattner d65598daa3 dispatch to functions like VisitBinRemAssign with knowledge that
the operand is of type CompoundAssignOperator, not just BinaryOperator.

llvm-svn: 41459
2007-08-26 21:40:28 +00:00
Chris Lattner 2c666fa40d update fixme's
llvm-svn: 41458
2007-08-26 21:27:07 +00:00
Chris Lattner 6f672c150c implement complex division
llvm-svn: 41457
2007-08-26 21:24:19 +00:00
Owen Anderson 2b9ec7ff33 Don't DSe volatile stores.
llvm-svn: 41456
2007-08-26 21:14:47 +00:00
Chris Lattner dd9a319158 Add isysroot support, patch by Keith Bauer
llvm-svn: 41455
2007-08-26 17:47:35 +00:00
Chris Lattner 0c6aad373f Fix %p format checking, patch by Keith Bauer.
llvm-svn: 41454
2007-08-26 17:39:38 +00:00
Chris Lattner 0d850bfed8 For warnings like this:
t.c:3:9: warning: invalid conversion '%B'
printf("%B\a\n", p);
~~~~~~  ^

Don't beep the console or print the newline.

llvm-svn: 41453
2007-08-26 17:38:22 +00:00
Chris Lattner 9decfbabd3 Fix a bug reported by Keith Bauer
llvm-svn: 41452
2007-08-26 17:32:59 +00:00
Chris Lattner 2e928885b2 fix a typo noticed by Gordon Henriksen
llvm-svn: 41451
2007-08-26 17:25:57 +00:00
Chris Lattner c3b3707536 llvmgcc is right :)
llvm-svn: 41450
2007-08-26 16:54:05 +00:00
Chris Lattner 183c231cf9 compound assignmetns work for scalars.
llvm-svn: 41449
2007-08-26 16:52:57 +00:00
Chris Lattner c141c1b390 implement conversions of complex to bool.
llvm-svn: 41448
2007-08-26 16:52:28 +00:00
Chris Lattner 268fcce4f0 remove ConvertScalarValueToBool.
llvm-svn: 41447
2007-08-26 16:46:58 +00:00
Chris Lattner e004438f4a reimplement ConvertScalarValueToBool in CGExprScalar.cpp
llvm-svn: 41446
2007-08-26 16:42:57 +00:00
Chris Lattner 42e6b8150a refactor some code to expose compex->scalar conversion to CGF
llvm-svn: 41445
2007-08-26 16:34:22 +00:00
Chris Lattner b84bb95b44 be slightly more volatile correct
llvm-svn: 41444
2007-08-26 16:22:13 +00:00
Steve Naroff 5f90ca9904 Fix bogus warnings (noticed by Chris) with array-constraints.c.
Remove bogus type conversions in Sema::GetTypeForDeclarator(). This commit
only deals with the array types (DeclaratorCheck::Array), though the
rest of this routine should be reviewed. Given the complexity of C declarators,
I don't want to change the entire routine now (will discuss with Chris tomorrow).

llvm-svn: 41443
2007-08-26 14:38:38 +00:00
Chris Lattner f6dcc9df7e these fixme's are easy :)
llvm-svn: 41442
2007-08-26 07:30:49 +00:00
Chris Lattner b753f66339 implement a fixme, add a couple more :)
llvm-svn: 41441
2007-08-26 07:29:23 +00:00
Chris Lattner 5de3b174c8 there are no conversions from aggregates to scalars.
llvm-svn: 41440
2007-08-26 07:26:12 +00:00
Chris Lattner 08c611e4dc implement conversions from complex to scalar types.
llvm-svn: 41439
2007-08-26 07:21:11 +00:00
Chris Lattner 46c7161311 Omit EmitConversion
llvm-svn: 41438
2007-08-26 07:16:41 +00:00
Chris Lattner 45067906ad Fix return of aggregate and return of complex.
llvm-svn: 41437
2007-08-26 07:14:44 +00:00
Chris Lattner 44d3e74e22 these implicit conversions are now explicit :)
llvm-svn: 41436
2007-08-26 07:09:42 +00:00
Chris Lattner cf3da8495a remove uses of EmitConversion
llvm-svn: 41435
2007-08-26 07:08:39 +00:00
Chris Lattner 798da7033f implicit casts take care of this code, remove it now.
llvm-svn: 41434
2007-08-26 07:06:24 +00:00
Chris Lattner 3474c202ab refactor scalar conversions out into CGExprScalar.cpp
llvm-svn: 41433
2007-08-26 06:48:56 +00:00
Chris Lattner e026ebd6fe steve's recent changes fixed this bogus warning.
llvm-svn: 41432
2007-08-26 06:48:28 +00:00
Chris Lattner 1a76a3c970 Break the assumption that any sort of scope (e.g. a loop scope) can
hold declarations.  Instead, introduce a new "DeclScope" scope type that
holds them explicitly.  For now, all scopes have this bit, but in the 
future we can use them to fix some issues Neil noticed.

llvm-svn: 41431
2007-08-26 06:24:45 +00:00
Chris Lattner 88078594fc remove some dead enum values.
llvm-svn: 41430
2007-08-26 06:03:04 +00:00
Chris Lattner 7460f9620c Implement casts from scalar -> complex and complex->complex.
llvm-svn: 41429
2007-08-26 05:57:57 +00:00
Chris Lattner e267f5d2f7 require that operands to __real/__imag are complex or arithmetic. This
fixes GCC PR33193

llvm-svn: 41428
2007-08-26 05:39:26 +00:00
Chris Lattner b5e1262437 implement codegen of __imag of a scalar. Our impl doesn't suffer from
GCC bug PR33192.

llvm-svn: 41427
2007-08-26 05:29:21 +00:00
Chris Lattner 9de9527ad6 Make initialization of complex vars work.
llvm-svn: 41426
2007-08-26 05:13:54 +00:00
Chris Lattner a01d898ff5 fix codegen of pre/post inc/dec of a pointer.
llvm-svn: 41425
2007-08-26 05:10:16 +00:00
Chris Lattner c7f06ca780 tolerate unimplemented codegen better
llvm-svn: 41424
2007-08-26 05:06:40 +00:00
Chris Lattner e7a160b37d int X[] isn't a VLA. This improves support for stdio.h on darwin.
llvm-svn: 41423
2007-08-26 05:02:07 +00:00
Neil Booth cd995b0b4a Make some diags EXTENSION so they are errors with pedantic errors
llvm-svn: 41422
2007-08-26 05:01:15 +00:00
Chris Lattner 57c269b5d3 implement rudimentary union layout support.
llvm-svn: 41421
2007-08-26 04:50:19 +00:00
Chris Lattner 5e75e8bc71 Why didn't gcc catch this? :(
llvm-svn: 41420
2007-08-26 04:42:42 +00:00
Chris Lattner 881440f5d2 Don't make unknown builtins fatal errors yet.
llvm-svn: 41419
2007-08-26 04:17:05 +00:00
Chris Lattner c5221650b3 remove a bunch of dead code
llvm-svn: 41418
2007-08-26 04:13:58 +00:00
Chris Lattner 71236d0485 fix a bug introduced by the recent childification of ForStmt.
llvm-svn: 41417
2007-08-26 04:11:23 +00:00
Chris Lattner b677a9398a Make parse-ast-print print the storage class and inline
specifier of functions.

llvm-svn: 41416
2007-08-26 04:02:13 +00:00
Chris Lattner 1c72d77d01 null pointers don't get an extra newline.
llvm-svn: 41415
2007-08-26 03:53:29 +00:00
Chris Lattner 0fffcb5b28 implement codegen for complex literals.
llvm-svn: 41414
2007-08-26 03:51:12 +00:00
Chris Lattner 1c20a170c0 add a new ImaginaryLiteral AST node that is used to
represent imaginary literals:

float _Complex A;
void foo() {
  A = 1.0iF;
}

generates:

  (BinaryOperator 0x2305ec0 '_Complex float' '='
    (DeclRefExpr 0x2305e60 '_Complex float' Decl='A' 0x2305cf0)
    (ImaginaryLiteral 0x2305f40 '_Complex float'
      (FloatingLiteral 0x2305ea0 'float' 1.000000))))

llvm-svn: 41413
2007-08-26 03:42:43 +00:00
Chris Lattner ed045421a8 1.0 is double, 1.0F is a float.
llvm-svn: 41412
2007-08-26 03:29:23 +00:00
Chris Lattner f55ab18663 1) refactor some code.
2) Add support for lexing imaginary constants (a GCC extension):

t.c:5:10: warning: imaginary constants are an extension
  A = 1.0iF;
         ^

3) Make the 'invalid suffix' diagnostic pointer more accurate:

t.c:6:10: error: invalid suffix 'qF' on floating constant
  A = 1.0qF;
         ^

instead of:

t.c:6:10: error: invalid suffix 'qF' on floating constant
  A = 1.0qF;
      ^

llvm-svn: 41411
2007-08-26 01:58:14 +00:00