Chris Lattner
c5f4ab6372
test that vlas are checked in an objc method context.
...
llvm-svn: 69508
2009-04-19 05:20:37 +00:00
Chris Lattner
de6240cd45
apparently gotos aren't allowed at all in blocks. Stub out a testcase for when/if they are.
...
llvm-svn: 69507
2009-04-19 04:51:27 +00:00
Chris Lattner
4be550ec68
more testcases of variably modified types.
...
llvm-svn: 69506
2009-04-19 04:48:07 +00:00
Chris Lattner
1a1fdbd75d
move jump scope checking and related code out into its own file, SemaDecl.cpp is
...
already too large.
llvm-svn: 69505
2009-04-19 04:46:21 +00:00
Daniel Dunbar
2355ea2625
Some more tweaks to driver documentation.
...
llvm-svn: 69504
2009-04-19 02:33:12 +00:00
Daniel Dunbar
9a7a78b0ae
Fix bug in computation of ivar offsets for (adjacent) bitfields.
...
- The confusing IRgen bitfield interface is partly to blame here;
fixing the functional error for now, cleanups to the interface to
follow.
llvm-svn: 69503
2009-04-19 02:03:42 +00:00
Chris Lattner
ecbcb3ab0b
minor typographical fixes
...
llvm-svn: 69502
2009-04-19 02:02:45 +00:00
Chris Lattner
cd3bb8f7e4
revert david's patch, which causes a testsuite failure.
...
llvm-svn: 69501
2009-04-19 01:33:30 +00:00
Chris Lattner
cc6892e336
rewrite an O(N^2) algorithm to be O(n).
...
llvm-svn: 69500
2009-04-19 01:32:00 +00:00
Chris Lattner
c67540501f
second half of indirect jump checking: make sure that any
...
address taken labels are in function scope
llvm-svn: 69499
2009-04-19 01:16:06 +00:00
Chris Lattner
0bf2dd2ed4
First half of jump scope checking for indirect goto.
...
llvm-svn: 69498
2009-04-19 01:05:26 +00:00
Chris Lattner
34d9a51892
Add location info for indirect goto.
...
llvm-svn: 69497
2009-04-19 01:04:21 +00:00
Daniel Dunbar
bf90b33665
Reuse ObjcIvarOffsetVariable instead of duplicating code.
...
- No functionality change (but added a FIXME).
llvm-svn: 69496
2009-04-19 00:44:02 +00:00
Daniel Dunbar
a106052090
Remove some unnecessary complexity.
...
- No functionality change.
llvm-svn: 69495
2009-04-19 00:31:15 +00:00
Mikhail Glushenkov
c48ede23bd
Add some assertions.
...
Fixes segfaults in some corner cases.
llvm-svn: 69494
2009-04-19 00:22:35 +00:00
Chris Lattner
c1b96c3590
"This patch fixes message sends to super in class methods for the GNU runtime (currently an instance method lookup is being performed)."
...
Patch by David Chisnall!
llvm-svn: 69493
2009-04-18 23:12:40 +00:00
Chris Lattner
19bd27f493
add some testcases that we do not correctly handle.
...
llvm-svn: 69492
2009-04-18 23:07:55 +00:00
Chris Lattner
f7fcb516de
reimplement DeclStmt handling so that we correctly handle intermixed
...
VLA's and statement expressions.
llvm-svn: 69491
2009-04-18 23:01:20 +00:00
Chris Lattner
a0cfd6b610
rearrange.
...
llvm-svn: 69490
2009-04-18 22:56:52 +00:00
Chris Lattner
fb5ef701d5
add testcases for some more scary/horrible things that work.
...
llvm-svn: 69488
2009-04-18 22:42:18 +00:00
Chris Lattner
508253d64b
the scope checker does work with objc methods, add testcase.
...
llvm-svn: 69487
2009-04-18 22:37:38 +00:00
Chris Lattner
b6e368235a
I didn't understand how @catches were chained. Now that I get it, fix
...
the scope checker to not think @catches are nested in each other, eliminating
some bogus notes.
llvm-svn: 69486
2009-04-18 22:35:34 +00:00
Chris Lattner
bf78da7b36
Fix PR3917: the location of a #line directive is the location of the first _.
...
llvm-svn: 69485
2009-04-18 22:29:33 +00:00
Chris Lattner
93017cc12a
Change Preprocessor::AdvanceToTokenCharacter to stop at
...
the first real character of a token. For example, advancing
to byte 3 of foo\
bar
should stop at the b, not the \.
llvm-svn: 69484
2009-04-18 22:28:58 +00:00
Chris Lattner
38b2cde4c4
add a new Lexer::SkipEscapedNewLines method.
...
llvm-svn: 69483
2009-04-18 22:27:02 +00:00
Chris Lattner
fbce7aa1f4
factor escape newline measuring out into its own helper function.
...
llvm-svn: 69482
2009-04-18 22:05:41 +00:00
Chris Lattner
dfbfc44df7
remove unneeded scopes.
...
llvm-svn: 69481
2009-04-18 21:57:20 +00:00
Chris Lattner
637652d959
forgot to commit this before.
...
llvm-svn: 69480
2009-04-18 21:55:17 +00:00
Chris Lattner
397ca4a9ef
fix typo
...
llvm-svn: 69479
2009-04-18 21:55:02 +00:00
Bill Wendling
4d10aae8c2
Revert 69474 and 69475. They are causing failures during a bootstrap on Darwin.
...
llvm-svn: 69478
2009-04-18 21:45:27 +00:00
Chris Lattner
5c926f3660
reject invalid jumps among pieces of @try blocks. This seems to work
...
reasonably well except for the problem that @catches are nested within
each other in the AST, giving the ugly diagnostics in L8.
llvm-svn: 69477
2009-04-18 21:28:52 +00:00
Chris Lattner
1d4fc1bc6d
unconditionally check for goto correctness. This is because switch
...
statements don't end up in the LabelMap so we don't have a quick way
to filter them. We could add state to Sema (a "has vla" and "has
jump" bit) to try to filter this out, but that would be sort of gross
and I'm not convinced it is the best way. Thoughts welcome.
llvm-svn: 69476
2009-04-18 21:00:42 +00:00
Mikhail Glushenkov
d497a8bae1
Reconfigure.
...
Turns out that doing this by hand is easier than using autoreconf:-).
llvm-svn: 69475
2009-04-18 20:55:55 +00:00
Mikhail Glushenkov
73e9e021f1
Add a configure check for llvm-gcc (reapply).
...
llvm-svn: 69474
2009-04-18 20:55:28 +00:00
Chris Lattner
1e7da23983
testcase for PR3898
...
llvm-svn: 69473
2009-04-18 20:49:22 +00:00
Chris Lattner
7b01e66443
Fix PR3898, which manifests as failures on are an Xcore,
...
patch by Jakob Stoklund Olesen!
llvm-svn: 69472
2009-04-18 20:48:07 +00:00
Anders Carlsson
623dcae172
Use EmitCallArgs in EmitObjCMessageExpr.
...
llvm-svn: 69471
2009-04-18 20:29:27 +00:00
Daniel Dunbar
f45dbd8c7b
Test case would allow clang to fail.
...
llvm-svn: 69470
2009-04-18 20:23:29 +00:00
Anders Carlsson
603d6aff8b
Make CodeGenFunction::EmitCallArgs a template function that takes a generic "Type Info" parameter. The type info parameter knows how to iterate over its arguments.
...
llvm-svn: 69469
2009-04-18 20:20:22 +00:00
Anders Carlsson
982a65fdb6
Add functions for iterating over the argument types of an ObjCMethodDecl.
...
llvm-svn: 69468
2009-04-18 20:18:04 +00:00
Duncan Sands
e4ff21ba4b
Don't try to make BUILD_VECTOR operands have the same
...
type as the vector element type: allow them to be of
a wider integer type than the element type all the way
through the system, and not just as far as LegalizeDAG.
This should be safe because it used to be this way
(the old type legalizer would produce such nodes), so
backends should be able to handle it. In fact only
targets which have legal vector types with an illegal
promoted element type will ever see this (eg: <4 x i16>
on ppc). This fixes a regression with the new type
legalizer (vec_splat.ll). Also, treat SCALAR_TO_VECTOR
the same as BUILD_VECTOR. After all, it is just a
special case of BUILD_VECTOR.
llvm-svn: 69467
2009-04-18 20:16:54 +00:00
Chris Lattner
b0cb5b2db2
merge two tests.
...
llvm-svn: 69466
2009-04-18 20:12:56 +00:00
Chris Lattner
96b3139773
abstract the SwitchStack for blocks just like we do the goto labels.
...
This fixes a crash on invalid (test10). rdar://6805469
llvm-svn: 69465
2009-04-18 20:10:59 +00:00
Chris Lattner
f95894c1d2
fix two error paths out of ParseBlockLiteralExpression to
...
call ActOnBlockError so that CurBlock gets popped. This
fixes a crash on test/block-syntax-error.c when this new
assertion is enabled.
llvm-svn: 69464
2009-04-18 20:05:34 +00:00
Chris Lattner
3318e86541
refactor some code, adding a new getLabelMap() accessor method
...
so that clients can't poke the function-local one when they really
want the current block label. No functionality change.
llvm-svn: 69463
2009-04-18 20:01:55 +00:00
Chris Lattner
36dec99d12
Improve switch diagnostic to emit the "jump" message on the
...
specific bad case instead of on the switch. Putting it on the
switch means you don't know what case is the problem. For
example:
scope-check.c:54:3: error: illegal switch case into protected scope
case 2:
^
scope-check.c:53:9: note: jump bypasses initialization of variable length array
int a[x];
^
llvm-svn: 69462
2009-04-18 19:50:02 +00:00
Chris Lattner
7535f41c66
first step to getting switches giving "jump into vla scope" errors.
...
llvm-svn: 69461
2009-04-18 19:42:37 +00:00
Chris Lattner
8560addfa6
add some block goto test cases.
...
llvm-svn: 69460
2009-04-18 19:32:54 +00:00
Chris Lattner
ca4dc2e1ea
fix error recovery in the case of a jump to a label with no definition
...
to create a well formed AST instead of a dangling pointer. This resolves
several fixme's.
llvm-svn: 69459
2009-04-18 19:30:02 +00:00
Chris Lattner
61639745b6
glibc plays some weird games with multiple different definitions of
...
int8_t and games it with strange *_defined macros. Emulate its weirdness
for better compatibility with linux etc. Problem pointed out by anders
johnson.
llvm-svn: 69458
2009-04-18 19:11:11 +00:00