Chris Lattner
3da18eb22a
silence some warnings in an optimized build.
...
llvm-svn: 41352
2007-08-24 03:02:34 +00:00
Chris Lattner
11e0de5193
rename two files.
...
llvm-svn: 41350
2007-08-24 02:22:53 +00:00
Chris Lattner
db0d60d5b5
implement codegen of builtin_choose_expr for complex.
...
llvm-svn: 41349
2007-08-24 02:18:47 +00:00
Dale Johannesen
a719a60609
Change internal representation of ConstantFP to use APFloat.
...
Interface to rest of the compiler unchanged, as yet.
llvm-svn: 41348
2007-08-24 00:56:33 +00:00
Chris Lattner
8ad56707ea
stub out complex -> bool conversion.
...
llvm-svn: 41347
2007-08-24 00:01:20 +00:00
Chris Lattner
afd455c0cf
make this harder
...
llvm-svn: 41346
2007-08-23 23:49:47 +00:00
Chris Lattner
0b984995b7
implement complex subtraction
...
llvm-svn: 41345
2007-08-23 23:46:33 +00:00
Chris Lattner
08b15df766
implement passing of complex and aggregates through call args.
...
llvm-svn: 41344
2007-08-23 23:43:33 +00:00
Chris Lattner
247ef955bc
in the truncation case, make sure to propagate the sign correctly, this
...
fixes an assertion on:
void f (int z) { switch (z) { case ~0ULL: case -1: return; } }
testcase from Neil.
llvm-svn: 41343
2007-08-23 22:08:35 +00:00
Steve Naroff
8ddb23a6c5
Support '~' for complex conjugation. This is a GCC extension.
...
This following now compiles without error...
_Complex unsigned X, Y;
_Complex double x, y;
void test2(int c) {
X = ~Y;
x = ~y;
}
llvm-svn: 41341
2007-08-23 22:06:40 +00:00
Chris Lattner
7b939cf606
fix a bug where we would type 0ULL as unsigned instead of unsigned long long
...
llvm-svn: 41340
2007-08-23 21:58:08 +00:00
Chris Lattner
e5b60445e7
Pretty print as:
...
"case sizeof x:"
instead of:
"case sizeofx:"
llvm-svn: 41339
2007-08-23 21:46:40 +00:00
Chris Lattner
9568880c3e
sizeof(x) doesn't require x to be an i-c-e for sizeof to be an i-c-e. Thanks to Neil for pointing this out.
...
llvm-svn: 41338
2007-08-23 21:42:50 +00:00
Ted Kremenek
9aae513318
No functionality change. Moved visitor methods for CFGBuilder out-of-line
...
from the class declaration. This enables a nice view of what visitor methods
have been implemented.
llvm-svn: 41337
2007-08-23 21:42:29 +00:00
Chris Lattner
1aaab49a3e
add support for codegen of calls returning complex.
...
llvm-svn: 41336
2007-08-23 21:38:16 +00:00
Steve Naroff
9e1e551c01
Remove a FIXME, allowing ++/-- on Complex types (a GCC extension).
...
Now, the following test case succeeds...
_Complex double x, y;
void test2(int c) {
++x;
}
llvm-svn: 41335
2007-08-23 21:37:33 +00:00
Ted Kremenek
04cca64f8c
moved CFGBuilder into an anonymous namespace
...
llvm-svn: 41334
2007-08-23 21:26:19 +00:00
Steve Naroff
4e1f80d255
- Cleanup "hack" comment and fix typos.
...
- Use getLang().ObjC2 when appropriate.
llvm-svn: 41333
2007-08-23 19:56:30 +00:00
Ted Kremenek
879d8e1f77
Added support for switch, default, and case statements in source-level CFGs.
...
llvm-svn: 41332
2007-08-23 18:43:24 +00:00
Chris Lattner
67998451c7
finish off switch case overlap checking, adding support for
...
verifying case ranges.
llvm-svn: 41331
2007-08-23 18:29:20 +00:00
Steve Naroff
7c34817902
Add helper functions Token::isObjCAtKeyword() and Token::getObjCKeywordID().
...
Convert all clients to the new cleaner, more robust API.
llvm-svn: 41330
2007-08-23 18:16:40 +00:00
Ted Kremenek
13fdfe99cd
Refactored "getSubStmt" and "SubStmt" from the CaseStmt and DefaultStmt
...
class to their common parent class SwitchCase.
llvm-svn: 41329
2007-08-23 18:04:38 +00:00
Chris Lattner
f81460f99c
detect and diagnose empty case ranges:
...
switch.c:16:8: warning: empty case range specified
case 100 ... 99: ; // expected-warning {{empty case range}}
^~~~~~~~~~
llvm-svn: 41328
2007-08-23 17:48:14 +00:00
Ted Kremenek
9ee3bcf81c
For gotos, breaks, and continues where we cannot find a target successor
...
block (because we are creating a CFG from an incomplete AST) we now
(gracefully) have a block ending with such statements not have any successors
instead of firing an assertion.
llvm-svn: 41327
2007-08-23 17:29:58 +00:00
Duncan Sands
a0f12c5493
Fix this testcase: there are two matches for
...
llvm.cttz.i64 because of the declaration of
the intrinsic. Also, emit-llvm is automatic
and doesn't need to be specified.
llvm-svn: 41326
2007-08-23 17:22:50 +00:00
Ted Kremenek
9443f5b1e0
Added support for do..while loops in CFG construction.
...
llvm-svn: 41325
2007-08-23 17:15:32 +00:00
Ted Kremenek
07b5b52cd0
Modified CFG to have explicit "Exit" pointer for exit block. This should
...
have been committed with my previous patch.
llvm-svn: 41324
2007-08-23 16:51:52 +00:00
Ted Kremenek
889073f785
Renamed "CFG::BuildCFG" to "CFG::buildCFG" to have more consistent capitalization.
...
Added explicit "Exit" CFGBlock pointer to the source-level CFG.
Changed the construction of blocks with "return" statements to have the
return statement appear both as a statement in the list of statements for
a CFGBlock as well as appear as a control-flow terminator. Also removed
the implicit linearization of "return" so that the return value and the
return statement did not appear as separate statements in the block.
llvm-svn: 41323
2007-08-23 16:51:22 +00:00
Anders Carlsson
cb8f832c26
As suggested by Chris, use MatchRHSPunctuation instead of manually looking for a right parenthesis when parsing @encode() and @protocol().
...
llvm-svn: 41321
2007-08-23 15:31:37 +00:00
Anders Carlsson
e01493d47b
Parse ObjC @protocol expressions.
...
llvm-svn: 41320
2007-08-23 15:25:28 +00:00
Chris Lattner
33800d1428
add some notes on really poor codegen.
...
llvm-svn: 41319
2007-08-23 15:22:07 +00:00
Chris Lattner
92c6a65d4e
new example
...
llvm-svn: 41318
2007-08-23 15:16:03 +00:00
Chris Lattner
fcb920d32b
fix a segfault in cases where there are no cases.
...
llvm-svn: 41317
2007-08-23 14:29:07 +00:00
Anton Korobeynikov
97cdac8d19
Perform correct codegen for eh_dwarf_cfa intrinsic.
...
llvm-svn: 41316
2007-08-23 07:21:06 +00:00
Chris Lattner
10cb5e520f
report duplicate case values. TODO: report duplicate/overlapping ranges.
...
llvm-svn: 41315
2007-08-23 06:23:56 +00:00
Chris Lattner
725c6a4279
this test is passing, though it is generating bogus code at the moment.
...
llvm-svn: 41314
2007-08-23 05:47:53 +00:00
Chris Lattner
fc1c44ac7d
start checking case values of switch stmts more closely. Emit overflow
...
warnings when converting case values to the expression type.
llvm-svn: 41313
2007-08-23 05:46:52 +00:00
Chris Lattner
53e5a38684
Update to match the API from LLVM mainline.
...
llvm-svn: 41312
2007-08-23 05:22:10 +00:00
Chris Lattner
06eca7a4ca
default this to radix 10 like the toString(Un)Signed methods.
...
llvm-svn: 41311
2007-08-23 05:21:48 +00:00
Chris Lattner
d2d32bae97
Avoid hiding issues.
...
llvm-svn: 41310
2007-08-23 05:20:48 +00:00
Chris Lattner
b0f158cfdf
rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()
...
Add an APSInt::toString() method.
llvm-svn: 41309
2007-08-23 05:15:32 +00:00
Chris Lattner
7d75c0d9b6
run .m files as tests
...
llvm-svn: 41308
2007-08-23 01:09:45 +00:00
Chris Lattner
c4e7a66036
Test that cocoa parses with -parse-noop. In the future
...
(when ready) this test should change to test -fsyntax-only.
llvm-svn: 41307
2007-08-23 01:08:54 +00:00
Duncan Sands
f2bcd37083
Implement review feedback on trampoline documentation.
...
llvm-svn: 41304
2007-08-22 23:39:54 +00:00
Steve Naroff
7e901fdf86
With this commit, we now successfully parse "Cocoa.h"!
...
llvm-svn: 41303
2007-08-22 23:18:22 +00:00
Ted Kremenek
0a6ec03884
Fixed bugs in source-level CFG construction for "for" and "while" loops
...
where break targets weren't being set and restored properly. Also
cleaned up CFGBuilder code for "for" and "while" to use less reliance
on globals and to have clearer semantics.
llvm-svn: 41302
2007-08-22 22:35:28 +00:00
Steve Naroff
c6e96bfef3
Fix a misleading comment...
...
llvm-svn: 41301
2007-08-22 22:19:13 +00:00
Steve Naroff
0b6a01a449
Add support for parsing protocols.
...
Now we can parse quite a bit of "Foundation.h" (a couple bugs remain).
llvm-svn: 41300
2007-08-22 22:17:26 +00:00
Ted Kremenek
e1810dee74
Added support for "break" statements in source-level ASTs.
...
Some comment cleanups.
llvm-svn: 41299
2007-08-22 21:51:58 +00:00
Ted Kremenek
1aebee0a4d
Added support for "continue" statements in source-level CFGs
...
Cleaned up some code for "for" and "while" loops by making their
implementations more symmetrical (and added a few comments).
llvm-svn: 41298
2007-08-22 21:36:54 +00:00