]> granicus.if.org Git - clang/log
clang
15 years agomerge pragma poison tests into one file with -verify mode.
Chris Lattner [Sun, 19 Apr 2009 20:15:59 +0000 (20:15 +0000)]
merge pragma poison tests into one file with -verify mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69538 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomerge two tests
Chris Lattner [Sun, 19 Apr 2009 20:10:12 +0000 (20:10 +0000)]
merge two tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69537 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3918: Invalid use of __VA_ARGS__ not diagnosed,
Chris Lattner [Sun, 19 Apr 2009 20:06:32 +0000 (20:06 +0000)]
Fix PR3918: Invalid use of __VA_ARGS__ not diagnosed,
by rejecting invalid poisoned tokens in the token
pasting path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69536 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAnother piece of the conditional operator puzzle. We'll want to use FindCompositePoin...
Sebastian Redl [Sun, 19 Apr 2009 19:26:31 +0000 (19:26 +0000)]
Another piece of the conditional operator puzzle. We'll want to use FindCompositePointerType in some other places, too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69534 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoconvert to -verify mode.
Chris Lattner [Sun, 19 Apr 2009 18:54:13 +0000 (18:54 +0000)]
convert to -verify mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69532 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR4006, incorrect handling of __VA_ARGS__ when it was the first token
Chris Lattner [Sun, 19 Apr 2009 18:26:34 +0000 (18:26 +0000)]
Fix PR4006, incorrect handling of __VA_ARGS__ when it was the first token
in a function-like macro body.  This has the added bonus of moving some
function-like macro specific code out of the object-like macro codepath.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69530 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoactually just do this on all x86 targets, it won't hurt
Chris Lattner [Sun, 19 Apr 2009 17:32:33 +0000 (17:32 +0000)]
actually just do this on all x86 targets, it won't hurt
non-glibc ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69528 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDefine __NO_MATH_INLINES on linux/x86 so that we don't get inline
Chris Lattner [Sun, 19 Apr 2009 17:29:50 +0000 (17:29 +0000)]
Define __NO_MATH_INLINES on linux/x86 so that we don't get inline
functions in glibc header files that use FP Stack inline asm which the
backend can't deal with (PR879).

This "fixes" PR3970 for linux.  Other affected systems should do similar
things.  Maybe this should just go to the general i386/x86-64 sections?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69527 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement compiler support for -fno-diagnostics-fixit-info,
Chris Lattner [Sun, 19 Apr 2009 07:44:08 +0000 (07:44 +0000)]
implement compiler support for -fno-diagnostics-fixit-info,
rdar://6805442

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69525 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoinvalid directives can occur in #if 0 code, just pass them
Chris Lattner [Sun, 19 Apr 2009 07:32:03 +0000 (07:32 +0000)]
invalid directives can occur in #if 0 code, just pass them
through like other directives PTH doesn't care about.  This
should fix rdar://6804029

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69524 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake PTH not crash on a null directive (# on its own line)
Chris Lattner [Sun, 19 Apr 2009 07:25:40 +0000 (07:25 +0000)]
make PTH not crash on a null directive (# on its own line)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69523 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agouse isNot instead of !is
Chris Lattner [Sun, 19 Apr 2009 07:15:51 +0000 (07:15 +0000)]
use isNot instead of !is

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69522 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix -fdollars-in-identifiers to have a default that is overriden
Chris Lattner [Sun, 19 Apr 2009 07:06:52 +0000 (07:06 +0000)]
fix -fdollars-in-identifiers to have a default that is overriden
by the command line option if present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69521 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix rdar://6804322 by wiring up -fdollars-in-identifiers
Chris Lattner [Sun, 19 Apr 2009 07:00:02 +0000 (07:00 +0000)]
fix rdar://6804322 by wiring up -fdollars-in-identifiers
with assembler-with-cpp mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69520 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosilence a warning, it isn't clear what the right answer is here,
Chris Lattner [Sun, 19 Apr 2009 06:59:18 +0000 (06:59 +0000)]
silence a warning, it isn't clear what the right answer is here,
will talk to steve.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69519 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoconvert to -verify mode.
Chris Lattner [Sun, 19 Apr 2009 06:56:11 +0000 (06:56 +0000)]
convert to -verify mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69518 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosilence a warning, I need to talk to Devang about this code.
Chris Lattner [Sun, 19 Apr 2009 06:50:29 +0000 (06:50 +0000)]
silence a warning, I need to talk to Devang about this code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69517 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix rdar://6804402 - crash on objc implementations declared with
Chris Lattner [Sun, 19 Apr 2009 06:02:28 +0000 (06:02 +0000)]
Fix rdar://6804402 - crash on objc implementations declared with
@class but no implementation.  This was broken in all 3 runtime
impls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69512 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorearrange #include order.
Chris Lattner [Sun, 19 Apr 2009 05:30:08 +0000 (05:30 +0000)]
rearrange #include order.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69511 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorun the jump checker on blocks, even though they don't have gotos,
Chris Lattner [Sun, 19 Apr 2009 05:28:12 +0000 (05:28 +0000)]
run the jump checker on blocks, even though they don't have gotos,
they do allow switches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69510 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid
Chris Lattner [Sun, 19 Apr 2009 05:21:20 +0000 (05:21 +0000)]
add a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid
calling into the jump checker when a function or method is known to contain
no VLAs or @try blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69509 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotest that vlas are checked in an objc method context.
Chris Lattner [Sun, 19 Apr 2009 05:20:37 +0000 (05:20 +0000)]
test that vlas are checked in an objc method context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69508 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoapparently gotos aren't allowed at all in blocks. Stub out a testcase for when/if...
Chris Lattner [Sun, 19 Apr 2009 04:51:27 +0000 (04:51 +0000)]
apparently gotos aren't allowed at all in blocks.  Stub out a testcase for when/if they are.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69507 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomore testcases of variably modified types.
Chris Lattner [Sun, 19 Apr 2009 04:48:07 +0000 (04:48 +0000)]
more testcases of variably modified types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69506 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove jump scope checking and related code out into its own file, SemaDecl.cpp is
Chris Lattner [Sun, 19 Apr 2009 04:46:21 +0000 (04:46 +0000)]
move jump scope checking and related code out into its own file, SemaDecl.cpp is
already too large.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69505 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSome more tweaks to driver documentation.
Daniel Dunbar [Sun, 19 Apr 2009 02:33:12 +0000 (02:33 +0000)]
Some more tweaks to driver documentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69504 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix bug in computation of ivar offsets for (adjacent) bitfields.
Daniel Dunbar [Sun, 19 Apr 2009 02:03:42 +0000 (02:03 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69503 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agominor typographical fixes
Chris Lattner [Sun, 19 Apr 2009 02:02:45 +0000 (02:02 +0000)]
minor typographical fixes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69502 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorevert david's patch, which causes a testsuite failure.
Chris Lattner [Sun, 19 Apr 2009 01:33:30 +0000 (01:33 +0000)]
revert david's patch, which causes a testsuite failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69501 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorewrite an O(N^2) algorithm to be O(n).
Chris Lattner [Sun, 19 Apr 2009 01:32:00 +0000 (01:32 +0000)]
rewrite an O(N^2) algorithm to be O(n).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69500 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosecond half of indirect jump checking: make sure that any
Chris Lattner [Sun, 19 Apr 2009 01:16:06 +0000 (01:16 +0000)]
second half of indirect jump checking: make sure that any
address taken labels are in function scope

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69499 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFirst half of jump scope checking for indirect goto.
Chris Lattner [Sun, 19 Apr 2009 01:05:26 +0000 (01:05 +0000)]
First half of jump scope checking for indirect goto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69498 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd location info for indirect goto.
Chris Lattner [Sun, 19 Apr 2009 01:04:21 +0000 (01:04 +0000)]
Add location info for indirect goto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReuse ObjcIvarOffsetVariable instead of duplicating code.
Daniel Dunbar [Sun, 19 Apr 2009 00:44:02 +0000 (00:44 +0000)]
Reuse ObjcIvarOffsetVariable instead of duplicating code.
 - No functionality change (but added a FIXME).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69496 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove some unnecessary complexity.
Daniel Dunbar [Sun, 19 Apr 2009 00:31:15 +0000 (00:31 +0000)]
Remove some unnecessary complexity.
 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69495 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago"This patch fixes message sends to super in class methods for the GNU runtime (curren...
Chris Lattner [Sat, 18 Apr 2009 23:12:40 +0000 (23:12 +0000)]
"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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69493 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd some testcases that we do not correctly handle.
Chris Lattner [Sat, 18 Apr 2009 23:07:55 +0000 (23:07 +0000)]
add some testcases that we do not correctly handle.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69492 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoreimplement DeclStmt handling so that we correctly handle intermixed
Chris Lattner [Sat, 18 Apr 2009 23:01:20 +0000 (23:01 +0000)]
reimplement DeclStmt handling so that we correctly handle intermixed
VLA's and statement expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69491 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorearrange.
Chris Lattner [Sat, 18 Apr 2009 22:56:52 +0000 (22:56 +0000)]
rearrange.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69490 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd testcases for some more scary/horrible things that work.
Chris Lattner [Sat, 18 Apr 2009 22:42:18 +0000 (22:42 +0000)]
add testcases for some more scary/horrible things that work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69488 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agothe scope checker does work with objc methods, add testcase.
Chris Lattner [Sat, 18 Apr 2009 22:37:38 +0000 (22:37 +0000)]
the scope checker does work with objc methods, add testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69487 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoI didn't understand how @catches were chained. Now that I get it, fix
Chris Lattner [Sat, 18 Apr 2009 22:35:34 +0000 (22:35 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69486 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3917: the location of a #line directive is the location of the first _.
Chris Lattner [Sat, 18 Apr 2009 22:29:33 +0000 (22:29 +0000)]
Fix PR3917: the location of a #line directive is the location of the first _.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69485 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange Preprocessor::AdvanceToTokenCharacter to stop at
Chris Lattner [Sat, 18 Apr 2009 22:28:58 +0000 (22:28 +0000)]
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 \.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69484 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a new Lexer::SkipEscapedNewLines method.
Chris Lattner [Sat, 18 Apr 2009 22:27:02 +0000 (22:27 +0000)]
add a new Lexer::SkipEscapedNewLines method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69483 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofactor escape newline measuring out into its own helper function.
Chris Lattner [Sat, 18 Apr 2009 22:05:41 +0000 (22:05 +0000)]
factor escape newline measuring out into its own helper function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69482 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove unneeded scopes.
Chris Lattner [Sat, 18 Apr 2009 21:57:20 +0000 (21:57 +0000)]
remove unneeded scopes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69481 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoforgot to commit this before.
Chris Lattner [Sat, 18 Apr 2009 21:55:17 +0000 (21:55 +0000)]
forgot to commit this before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69480 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix typo
Chris Lattner [Sat, 18 Apr 2009 21:55:02 +0000 (21:55 +0000)]
fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69479 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoreject invalid jumps among pieces of @try blocks. This seems to work
Chris Lattner [Sat, 18 Apr 2009 21:28:52 +0000 (21:28 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69477 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agounconditionally check for goto correctness. This is because switch
Chris Lattner [Sat, 18 Apr 2009 21:00:42 +0000 (21:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69476 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse EmitCallArgs in EmitObjCMessageExpr.
Anders Carlsson [Sat, 18 Apr 2009 20:29:27 +0000 (20:29 +0000)]
Use EmitCallArgs in EmitObjCMessageExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69471 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTest case would allow clang to fail.
Daniel Dunbar [Sat, 18 Apr 2009 20:23:29 +0000 (20:23 +0000)]
Test case would allow clang to fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69470 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake CodeGenFunction::EmitCallArgs a template function that takes a generic "Type...
Anders Carlsson [Sat, 18 Apr 2009 20:20:22 +0000 (20:20 +0000)]
Make CodeGenFunction::EmitCallArgs a template function that takes a generic "Type Info" parameter. The type info parameter knows how to iterate over its arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69469 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd functions for iterating over the argument types of an ObjCMethodDecl.
Anders Carlsson [Sat, 18 Apr 2009 20:18:04 +0000 (20:18 +0000)]
Add functions for iterating over the argument types of an ObjCMethodDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69468 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomerge two tests.
Chris Lattner [Sat, 18 Apr 2009 20:12:56 +0000 (20:12 +0000)]
merge two tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69466 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoabstract the SwitchStack for blocks just like we do the goto labels.
Chris Lattner [Sat, 18 Apr 2009 20:10:59 +0000 (20:10 +0000)]
abstract the SwitchStack for blocks just like we do the goto labels.
This fixes a crash on invalid (test10). rdar://6805469

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69465 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix two error paths out of ParseBlockLiteralExpression to
Chris Lattner [Sat, 18 Apr 2009 20:05:34 +0000 (20:05 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69464 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorefactor some code, adding a new getLabelMap() accessor method
Chris Lattner [Sat, 18 Apr 2009 20:01:55 +0000 (20:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69463 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove switch diagnostic to emit the "jump" message on the
Chris Lattner [Sat, 18 Apr 2009 19:50:02 +0000 (19:50 +0000)]
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];
        ^

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69462 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofirst step to getting switches giving "jump into vla scope" errors.
Chris Lattner [Sat, 18 Apr 2009 19:42:37 +0000 (19:42 +0000)]
first step to getting switches giving "jump into vla scope" errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69461 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd some block goto test cases.
Chris Lattner [Sat, 18 Apr 2009 19:32:54 +0000 (19:32 +0000)]
add some block goto test cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69460 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix error recovery in the case of a jump to a label with no definition
Chris Lattner [Sat, 18 Apr 2009 19:30:02 +0000 (19:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69459 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoglibc plays some weird games with multiple different definitions of
Chris Lattner [Sat, 18 Apr 2009 19:11:11 +0000 (19:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69458 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake sure to verify that the "non pch" runs worked.
Chris Lattner [Sat, 18 Apr 2009 18:45:36 +0000 (18:45 +0000)]
make sure to verify that the "non pch" runs worked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69457 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprove wording of scope violation error messages.
Chris Lattner [Sat, 18 Apr 2009 18:42:55 +0000 (18:42 +0000)]
improve wording of scope violation error messages.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69456 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename test
Chris Lattner [Sat, 18 Apr 2009 18:41:40 +0000 (18:41 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69455 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomore fun with line markers: the digit string is required to be interpreted
Chris Lattner [Sat, 18 Apr 2009 18:35:15 +0000 (18:35 +0000)]
more fun with line markers: the digit string is required to be interpreted
as decimal, even if it starts with 0.  Also, since things like 0x1 are
completely illegal, don't even bother using numericliteralparser for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69454 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't emit name-lookup tables for functions or methods in the PCH files
Douglas Gregor [Sat, 18 Apr 2009 15:49:20 +0000 (15:49 +0000)]
Don't emit name-lookup tables for functions or methods in the PCH files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69449 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix test to output LLVM to a temporary file, which we grep as part of the test
Douglas Gregor [Sat, 18 Apr 2009 15:48:37 +0000 (15:48 +0000)]
Fix test to output LLVM to a temporary file, which we grep as part of the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69448 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorewrite the goto scope checking code to be more efficient, simpler,
Chris Lattner [Sat, 18 Apr 2009 09:36:27 +0000 (09:36 +0000)]
rewrite the goto scope checking code to be more efficient, simpler,
produce better diagnostics, and be more correct in ObjC cases (fixing
rdar://6803963).

An example is that we now diagnose:

int test1(int x) {
  goto L;
  int a[x];
  int b[x];
  L:
  return sizeof a;
}

with:

scope-check.c:15:3: error: illegal goto into protected scope
  goto L;
  ^
scope-check.c:17:7: note: scope created by variable length array
  int b[x];
      ^
scope-check.c:16:7: note: scope created by variable length array
  int a[x];
      ^

instead of just saying "invalid jump".  An ObjC example is:

void test1() {
  goto L;
  @try {
L: ;
  } @finally {
  }
}

t.m:6:3: error: illegal goto into protected scope
  goto L;
  ^
t.m:7:3: note: scope created by @try block
  @try {
  ^

There are a whole ton of fixme's for stuff to do, but I believe that this
is a monotonic improvement over what we had.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69437 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd accessor.
Chris Lattner [Sat, 18 Apr 2009 09:27:30 +0000 (09:27 +0000)]
add accessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69436 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse getAsPointerType instead of using getCanonicalType directly.
Daniel Dunbar [Sat, 18 Apr 2009 08:54:40 +0000 (08:54 +0000)]
Use getAsPointerType instead of using getCanonicalType directly.
 - <rdar://problem/6803995>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69435 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a bug found by inspection, class/meta references could be emitted
Daniel Dunbar [Sat, 18 Apr 2009 08:51:00 +0000 (08:51 +0000)]
Fix a bug found by inspection, class/meta references could be emitted
into the wrong section (they shared the same lookup table).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69433 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd another testcase
Chris Lattner [Sat, 18 Apr 2009 07:54:11 +0000 (07:54 +0000)]
add another testcase

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69432 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodon't evaluate ->child_end() every time through the loop, or *i frequently within it.
Chris Lattner [Sat, 18 Apr 2009 07:53:55 +0000 (07:53 +0000)]
don't evaluate ->child_end() every time through the loop, or *i frequently within it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69431 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosplit code out into a new CheckFunctionJumpScopes routine,
Chris Lattner [Sat, 18 Apr 2009 07:47:21 +0000 (07:47 +0000)]
split code out into a new CheckFunctionJumpScopes routine,
add some comments, change type from void* -> Stmt*, use
smallvector instead of vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69430 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake scope checking be static functions instead of sema methods.
Chris Lattner [Sat, 18 Apr 2009 07:36:39 +0000 (07:36 +0000)]
make scope checking be static functions instead of sema methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69429 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix incorrect lowering of __builtin_ia32_shufpd, rdar://6803924
Chris Lattner [Sat, 18 Apr 2009 07:01:54 +0000 (07:01 +0000)]
fix incorrect lowering of __builtin_ia32_shufpd, rdar://6803924

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69428 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename file.
Chris Lattner [Sat, 18 Apr 2009 07:00:54 +0000 (07:00 +0000)]
rename file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69427 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodon't dump .ll file in this dir.
Chris Lattner [Sat, 18 Apr 2009 07:00:06 +0000 (07:00 +0000)]
don't dump .ll file in this dir.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69426 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago__builtin_prefetch should be declared as "void __builtin_prefetch(const void *)",
Chris Lattner [Sat, 18 Apr 2009 06:51:21 +0000 (06:51 +0000)]
__builtin_prefetch should be declared as "void __builtin_prefetch(const void *)",
not "const void __builtin_prefetch(void *)".  This fixes PR3912.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69425 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename test
Chris Lattner [Sat, 18 Apr 2009 06:49:47 +0000 (06:49 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69424 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR3927 by being more careful about the pp test for identifier.
Chris Lattner [Sat, 18 Apr 2009 06:44:18 +0000 (06:44 +0000)]
fix PR3927 by being more careful about the pp test for identifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69423 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosecond half of PR3940: #line requires simple digit sequence.
Chris Lattner [Sat, 18 Apr 2009 06:38:24 +0000 (06:38 +0000)]
second half of PR3940: #line requires simple digit sequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69422 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStore the type ID for __builtin_va_list in the PCH file, so that the
Douglas Gregor [Sat, 18 Apr 2009 05:55:16 +0000 (05:55 +0000)]
Store the type ID for __builtin_va_list in the PCH file, so that the
AST context's __builtin_va_list type will be set when the PCH file is
loaded. This fixes the crash when CodeGen'ing a va_arg expression
pulled in from a PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69421 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agothis is really just a recommendation, not a requirement.
Chris Lattner [Sat, 18 Apr 2009 02:25:14 +0000 (02:25 +0000)]
this is really just a recommendation, not a requirement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69416 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoenforce requirements imposed by C90 6.8 TC1, fixing PR3919.
Chris Lattner [Sat, 18 Apr 2009 02:23:25 +0000 (02:23 +0000)]
enforce requirements imposed by C90 6.8 TC1, fixing PR3919.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69415 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3938 by taking into account C99 6.10p4.
Chris Lattner [Sat, 18 Apr 2009 01:34:22 +0000 (01:34 +0000)]
Fix PR3938 by taking into account C99 6.10p4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69413 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoconvert test to -verify style.
Chris Lattner [Sat, 18 Apr 2009 01:33:54 +0000 (01:33 +0000)]
convert test to -verify style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69412 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSubstantially restructure function-like macro argument parsing.
Chris Lattner [Sat, 18 Apr 2009 01:13:56 +0000 (01:13 +0000)]
Substantially restructure function-like macro argument parsing.
Highlights: PP::isNextPPTokenLParen() no longer eats the (
when present.  We now simplify slightly the logic parsing
macro arguments.  We now handle PR3937 and other related cases
correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69411 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPreliminary PCH support in the driver
Douglas Gregor [Sat, 18 Apr 2009 00:34:01 +0000 (00:34 +0000)]
Preliminary PCH support in the driver

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69410 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLazy deserialization of function bodies for PCH files. For the Carbon
Douglas Gregor [Sat, 18 Apr 2009 00:07:54 +0000 (00:07 +0000)]
Lazy deserialization of function bodies for PCH files. For the Carbon
"Hello, World!", this takes us from deserializing 6469
statements/expressions down to deserializing 1
statement/expression. It only translated into a 1% improvement on the
Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b)
we expect this to matter more once we lazily deserialize identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69407 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFunctionDecl::getBody() is getting an ASTContext argument for use in
Douglas Gregor [Sat, 18 Apr 2009 00:02:19 +0000 (00:02 +0000)]
FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove dead diagnostic.
Chris Lattner [Fri, 17 Apr 2009 23:57:31 +0000 (23:57 +0000)]
remove dead diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69405 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix two problems from PR3916, and one problem I noticed while hacking
Chris Lattner [Fri, 17 Apr 2009 23:56:52 +0000 (23:56 +0000)]
Fix two problems from PR3916, and one problem I noticed while hacking
on the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69404 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement PR3940: #line numbers not fully checked
Chris Lattner [Fri, 17 Apr 2009 23:37:49 +0000 (23:37 +0000)]
implement PR3940: #line numbers not fully checked

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69403 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago#line is allowed to have macros that expand to nothing after them.
Chris Lattner [Fri, 17 Apr 2009 23:30:53 +0000 (23:30 +0000)]
#line is allowed to have macros that expand to nothing after them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69401 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoKeep track of the number of statements/expressions written to and read
Douglas Gregor [Fri, 17 Apr 2009 22:13:46 +0000 (22:13 +0000)]
Keep track of the number of statements/expressions written to and read
from a PCH file. It turns out that "Hello, World!" is bringing in 19%
of all of the statements in Carbon.h, so we need to be lazy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69393 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a crash compiling code with its own definition of objc_assign_weak.
Chris Lattner [Fri, 17 Apr 2009 22:12:36 +0000 (22:12 +0000)]
fix a crash compiling code with its own definition of objc_assign_weak.
rdar://6800430

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69392 91177308-0d34-0410-b5e6-96231b3b80d8