Commit Graph

35923 Commits

Author SHA1 Message Date
Duncan Sands d9a21103dc Test handling of complex constants as lvalues.
llvm-svn: 41266
2007-08-22 05:58:22 +00:00
Chris Lattner 8f44d20d69 optimize scope push/pop to avoid work in the common case.
llvm-svn: 41265
2007-08-22 05:33:11 +00:00
Chris Lattner 8fb2625b40 Fix the scoping issue Neil pointed out for the rest of
the selection statements and iteration statements.  Add
spec citations.

llvm-svn: 41264
2007-08-22 05:28:50 +00:00
Chris Lattner 37e54f454a Fix a nasty C99 scope issue that Neil pointed out (for ifs)
This fixes test/Parser/control-scope.c

llvm-svn: 41263
2007-08-22 05:16:28 +00:00
Ted Kremenek 8a63218855 Added CFG support for gotos and labels.
Modified CFG so that getEntry(), getExit(), front() and back() return
CFGBlock& instead of CFGBlock*.

llvm-svn: 41258
2007-08-21 23:26:17 +00:00
Anton Korobeynikov 3fc4a9f78a Dror GCCLibraries: they are obsolete since 2.0 release. This also reduces number of licenses used in LLVM.
llvm-svn: 41257
2007-08-21 22:40:44 +00:00
Chris Lattner cb1ffbc12e add some fixme's, implement complex struct members.
llvm-svn: 41256
2007-08-21 22:33:41 +00:00
Chris Lattner d34c999b67 implement codegen for --/++
llvm-svn: 41255
2007-08-21 22:25:29 +00:00
Ted Kremenek 1b8ac851d1 Converted CFGBuilder to use StmtVisitor instead of doing a switch
dispatch to walk the AST.

llvm-svn: 41254
2007-08-21 22:06:14 +00:00
Chris Lattner ce8f75bd5b add cfg.h/cfg.cpp to the xcode project at Ted's request.
llvm-svn: 41253
2007-08-21 21:44:59 +00:00
Ted Kremenek 4aa1e8b3b8 Added CFG infrastructure (CFG.cpp and CFG.h) for clang ASTs.
Added builder code to translate ASTs to CFGs.  This currently supports
if, return, and non-control flow statements.

Added pretty-printer to debug CFGs.

Added a "-dump-cfg" option to the clang driver to dump CFGs for code
sent through the frontend.

llvm-svn: 41252
2007-08-21 21:42:03 +00:00
Steve Naroff 00433d3d37 Implement parsing for objc instance variables.
Next step, method...

llvm-svn: 41251
2007-08-21 21:17:12 +00:00
Devang Patel a12000d572 Rename bunch of variables.
llvm-svn: 41250
2007-08-21 21:12:02 +00:00
Chris Lattner 875a519ca6 implement __extension__ and unary~ for complex.
llvm-svn: 41249
2007-08-21 20:41:44 +00:00
Ted Kremenek 76c4ac2363 Added reverse iterators for the body of CompountStmt. These are useful for
CFG construction (among other potential uses).

llvm-svn: 41248
2007-08-21 20:29:50 +00:00
Chris Lattner ad4569eacb implement codegen for complex unary +/-
llvm-svn: 41247
2007-08-21 20:08:23 +00:00
Devang Patel f98db5e62a Preserve LCSSA.
llvm-svn: 41246
2007-08-21 19:47:46 +00:00
Anders Carlsson 77621351dd Don't remove the grammar construct, just the TODO.
llvm-svn: 41245
2007-08-21 19:18:49 +00:00
Chris Lattner d614e7a553 minor nicities.
llvm-svn: 41244
2007-08-21 18:51:13 +00:00
Chris Lattner 43ba25187b Tweak error recovery for missing semicolon after decl. For this:
void foo() {
  int x
  if (x) {
  }
}

We now emit:

a.c:5:3: error: parse error
  if (x) {
  ^
1 diagnostic generated.

instead of:

a.c:5:3: error: parse error
  if (x) {
  ^
a.c:9:1: error: expected '}'

^
2 diagnostics generated.

llvm-svn: 41243
2007-08-21 18:36:18 +00:00
Chris Lattner 592d757c92 add unary operator support to the stmtvisitor
llvm-svn: 41242
2007-08-21 18:18:25 +00:00
Anders Carlsson 4f803dc6d3 Remove objc-string-literal since it's been implemented now.
llvm-svn: 41241
2007-08-21 18:14:25 +00:00
Chris Lattner a0733a777b implement support for complex subscripts.
llvm-svn: 41240
2007-08-21 18:03:58 +00:00
Chris Lattner e0e54120b2 allow support for volatile lvalues even though it's still not right.
llvm-svn: 41239
2007-08-21 18:02:02 +00:00
Anders Carlsson 76f4a902d7 Implement parsing and code generation of Objective-C string literals.
llvm-svn: 41238
2007-08-21 17:43:55 +00:00
Chris Lattner 2dc2af3515 add a new builder ivar.
llvm-svn: 41237
2007-08-21 17:39:38 +00:00
Chris Lattner 4b0e7873f6 move EmitLoadOfComplex/EmitStoreOfComplex into ComplexExprEmitter.
llvm-svn: 41236
2007-08-21 17:28:34 +00:00
Chris Lattner 3cf417b369 implement comma for complex.
llvm-svn: 41235
2007-08-21 17:15:50 +00:00
Chris Lattner 64be48fede and/or/xor are invalid for complex, even integer complex apparently.
llvm-svn: 41234
2007-08-21 17:12:50 +00:00
Chris Lattner bf1bd0dcc7 simplify code slightly
llvm-svn: 41233
2007-08-21 17:03:38 +00:00
Chris Lattner 755a5a9933 add sema support for complex integer types
llvm-svn: 41232
2007-08-21 17:02:28 +00:00
Chris Lattner 96d7256d62 reimplement support for complex comparisons, add support for integer complex compares.
llvm-svn: 41231
2007-08-21 16:57:55 +00:00
Devang Patel f5e520d892 Use SmallVector.
llvm-svn: 41230
2007-08-21 16:54:51 +00:00
Chris Lattner f78c30f75d add getAsComplexType() for consistency
llvm-svn: 41229
2007-08-21 16:54:08 +00:00
Devang Patel a9e7c4f827 No need to hardcode SmallVector size.
llvm-svn: 41228
2007-08-21 16:39:43 +00:00
Chris Lattner 18444b9660 Add the comparisons and logical binops to the visitor.
llvm-svn: 41227
2007-08-21 16:38:51 +00:00
Chris Lattner 6ce75dff4d reimplement complex mul
llvm-svn: 41226
2007-08-21 16:34:16 +00:00
Bruno Cardoso Lopes b10580ac1e InlineAsm asm support for integer registers added
llvm-svn: 41225
2007-08-21 16:09:25 +00:00
Bruno Cardoso Lopes d4b9945a21 Instruction Itinerary attribution fixed
llvm-svn: 41224
2007-08-21 16:06:45 +00:00
David Greene 80defa5a62 Doxygenize comments.
llvm-svn: 41222
2007-08-21 14:57:58 +00:00
Chris Lattner 85e9b4336a add a testcase I forgot to check in long ago
llvm-svn: 41219
2007-08-21 05:56:30 +00:00
Chris Lattner b01cc9d49a update some comments.
llvm-svn: 41218
2007-08-21 05:54:53 +00:00
Chris Lattner cbfc73b26c Split complex arithmetic codegen out from aggregate codegen.
This means that we get rid of tons of intermediate allocas.  For
example:

void foo(double _Complex a, double _Complex b) {
   a = b+a+a;
}

this used to have 4 temporary allocas, now it has zero of them.
This also simplifies the individual visitor methods because they
now can all operate on real/imag pairs instead of having to 
load/store all over the place.

llvm-svn: 41217
2007-08-21 05:54:00 +00:00
Chris Lattner 926792f726 simplify this a bit to remove indirection
llvm-svn: 41216
2007-08-21 05:02:10 +00:00
Chris Lattner 835635d85a reimplement addition of complex numbers.
llvm-svn: 41215
2007-08-21 04:59:27 +00:00
Chris Lattner cd9fb2401d Add the ability to visit binary operators without having to
match on binop then explicitly switching again.

llvm-svn: 41214
2007-08-21 04:43:17 +00:00
Chris Lattner 4758b40df0 switch aggregate expr codegen to use a visitor to localize most of the nasty
details in its own file.

llvm-svn: 41213
2007-08-21 04:25:47 +00:00
Chris Lattner ae963ae217 Now that the visitor is defined in one place, it is nice and easy to allow clients
to have visitors that return non-void.

llvm-svn: 41212
2007-08-21 04:06:29 +00:00
Chris Lattner 62249a6299 Switch StmtVisitor from using dynamic to static dispatch. This makes it
significantly faster and actually reduces the amount of code in the system.
This also allows for future visitor changes.

llvm-svn: 41211
2007-08-21 04:04:25 +00:00
Chris Lattner 91b9a4c8c3 we now correctly emit:
unused-expr.c:8:6: warning: comparison of distinct pointer types ('int volatile *' and 'int *')
  VP == P;
  ~~ ^  ~

llvm-svn: 41210
2007-08-21 01:19:46 +00:00