]> granicus.if.org Git - clang/log
clang
15 years agominor code cleanup
Chris Lattner [Wed, 29 Apr 2009 04:12:34 +0000 (04:12 +0000)]
minor code cleanup

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

15 years agoUpdate test case.
Zhongxing Xu [Wed, 29 Apr 2009 02:37:26 +0000 (02:37 +0000)]
Update test case.

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

15 years agoAs discussed with Ted offline, re-apply r70293.
Zhongxing Xu [Wed, 29 Apr 2009 02:30:09 +0000 (02:30 +0000)]
As discussed with Ted offline, re-apply r70293.

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

15 years agoXFAIL the test case.
Zhongxing Xu [Wed, 29 Apr 2009 01:50:12 +0000 (01:50 +0000)]
XFAIL the test case.

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

15 years agoAdd incredibly bare bones docs/tools.
Daniel Dunbar [Wed, 29 Apr 2009 01:00:32 +0000 (01:00 +0000)]
Add incredibly bare bones docs/tools.
 - Mirroring LLVM's docs/CommandGuide, a place to put .pod files which
   are used to generate man/html/etc documentation for tools provided
   as part of clang.

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

15 years agoImplement sema checking for noreturn.
Mike Stump [Wed, 29 Apr 2009 00:43:21 +0000 (00:43 +0000)]
Implement sema checking for noreturn.

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

15 years agoretain/release checker: Refactor the guts of getClassMethodSummary to not depend
Ted Kremenek [Wed, 29 Apr 2009 00:42:39 +0000 (00:42 +0000)]
retain/release checker: Refactor the guts of getClassMethodSummary to not depend
on ObjCMessageExpr. This will enable us to use it elsewhere. This should not
change any functionality.

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

15 years agoAdd regression test case provided by <rdar://problem/6833332>.
Ted Kremenek [Wed, 29 Apr 2009 00:41:31 +0000 (00:41 +0000)]
Add regression test case provided by <rdar://problem/6833332>.

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

15 years agoEnable PCH by default
Douglas Gregor [Tue, 28 Apr 2009 22:44:02 +0000 (22:44 +0000)]
Enable PCH by default

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

15 years agoForce driver's PTH test to use PTH
Douglas Gregor [Tue, 28 Apr 2009 22:43:20 +0000 (22:43 +0000)]
Force driver's PTH test to use PTH

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

15 years agoIn -fdiagnostics-print-source-range-info mode, print a space before the
Chris Lattner [Tue, 28 Apr 2009 22:33:16 +0000 (22:33 +0000)]
In -fdiagnostics-print-source-range-info mode, print a space before the
lines that clang extracts from the source code so that machine parsing can
easily ignore them.

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

15 years agoImplement ownership attribute 'objc_ownership_make_collectable'. This allows one
Ted Kremenek [Tue, 28 Apr 2009 22:32:26 +0000 (22:32 +0000)]
Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.

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

15 years agoadd support for -Wendif-labels, PR4101
Chris Lattner [Tue, 28 Apr 2009 22:19:16 +0000 (22:19 +0000)]
add support for -Wendif-labels, PR4101

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

15 years agoMake all PCH-incompatibility warnings into errors, and abort
Douglas Gregor [Tue, 28 Apr 2009 22:01:16 +0000 (22:01 +0000)]
Make all PCH-incompatibility warnings into errors, and abort
compilation if the user requested a PCH file but no such PCH file
exists.

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

15 years agoMake the PCH reader use the diagnostics system for its complaints.
Douglas Gregor [Tue, 28 Apr 2009 21:53:25 +0000 (21:53 +0000)]
Make the PCH reader use the diagnostics system for its complaints.

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

15 years agoImplement -Wfour-char-constants, which is an extension, not an extwarn,
Chris Lattner [Tue, 28 Apr 2009 21:51:46 +0000 (21:51 +0000)]
Implement -Wfour-char-constants, which is an extension, not an extwarn,
and apparently not part of -Wall

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

15 years agoImprove retain/release test cases for ownership attributes.
Ted Kremenek [Tue, 28 Apr 2009 21:43:40 +0000 (21:43 +0000)]
Improve retain/release test cases for ownership attributes.

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

15 years agoOptimize IdentifierInfo storage within the precompiled header. We've
Douglas Gregor [Tue, 28 Apr 2009 21:32:13 +0000 (21:32 +0000)]
Optimize IdentifierInfo storage within the precompiled header. We've
now gotten back about 180k of the 500k we lost.

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

15 years agoImplement a minor space optimization for the PCH identifier table,
Douglas Gregor [Tue, 28 Apr 2009 21:18:29 +0000 (21:18 +0000)]
Implement a minor space optimization for the PCH identifier table,
which eliminates the storage for IdentifierInfo in the "uninteresting
identifier" cases. Sadly, this only brought back 7k of the 500k we
lost :(

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

15 years agoFix a typo noticed by Gabor
Douglas Gregor [Tue, 28 Apr 2009 21:06:13 +0000 (21:06 +0000)]
Fix a typo noticed by Gabor

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

15 years agoReplace a lame fprintf with a slightly-less lame diagnostic
Douglas Gregor [Tue, 28 Apr 2009 20:36:16 +0000 (20:36 +0000)]
Replace a lame fprintf with a slightly-less lame diagnostic

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

15 years agoImplement checking for macro definitions that occur on the command
Douglas Gregor [Tue, 28 Apr 2009 20:33:11 +0000 (20:33 +0000)]
Implement checking for macro definitions that occur on the command
line when using a PCH that were not provided when building the PCH
file. If those names were used as identifiers somewhere in the PCH
file, reject the PCH file.

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

15 years agoRevert r70075 and r70078, which reorganized the PCH on-disk hash table
Douglas Gregor [Tue, 28 Apr 2009 20:01:51 +0000 (20:01 +0000)]
Revert r70075 and r70078, which reorganized the PCH on-disk hash table
for identifiers to separate "interesting" from "uninteresting"
identifiers. However, to cope with compiler invocations where the
predefines buffers mismatch, we need to be able to search the complete
identifier table. Cocoa.h.pch is now about 500k larger that it used to
be :(

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

15 years agoWith -ccc-pch-is-pch, always treat precompiled inputs as PCH,
Daniel Dunbar [Tue, 28 Apr 2009 19:38:45 +0000 (19:38 +0000)]
With -ccc-pch-is-pch, always treat precompiled inputs as PCH,
regardless of extension.
 - Otherwise we can't expect that just plugging in -ccc-pch-is-pch
   will work.

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

15 years agoPR4097: add logic to Evaluate to handle pointer equality comparisons.
Eli Friedman [Tue, 28 Apr 2009 19:17:36 +0000 (19:17 +0000)]
PR4097: add logic to Evaluate to handle pointer equality comparisons.

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

15 years agoAllow some differences between the predefines buffer used to build a
Douglas Gregor [Tue, 28 Apr 2009 18:58:38 +0000 (18:58 +0000)]
Allow some differences between the predefines buffer used to build a
PCH file and the predefines buffer used when including the PCH
file. We (explicitly) detect conflicting macro definitions (rejecting
the PCH file) and about missing macro definitions (they'll be
automatically pulled from the PCH file anyway).

We're missing some checking to make sure that new macro definitions
won't have any impact on the PCH file itself (e.g., #define'ing an
identifier that the PCH file used).

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

15 years agoimplement -Wmultichar
Chris Lattner [Tue, 28 Apr 2009 18:52:02 +0000 (18:52 +0000)]
implement -Wmultichar

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

15 years agoAdd some text to the user manual describing the current state of C
Eli Friedman [Tue, 28 Apr 2009 18:48:34 +0000 (18:48 +0000)]
Add some text to the user manual describing the current state of C
support in clang.

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

15 years agoRevert 70293.
Ted Kremenek [Tue, 28 Apr 2009 18:48:13 +0000 (18:48 +0000)]
Revert 70293.

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

15 years agomerge number.c into constants.c and start running it in -verify mode.
Chris Lattner [Tue, 28 Apr 2009 18:43:12 +0000 (18:43 +0000)]
merge number.c into constants.c and start running it in -verify mode.

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

15 years agoFix a minor edge case in C89 mode related to the definition of a
Eli Friedman [Tue, 28 Apr 2009 17:59:09 +0000 (17:59 +0000)]
Fix a minor edge case in C89 mode related to the definition of a
"function designator".

(This causes a minor glitch in the
diagnostics for C++ member pointers, but we weren't printing the
right diagnostic there anyway.)

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

15 years agoFix additional issues pointed out in PR4088.
Eli Friedman [Tue, 28 Apr 2009 17:48:05 +0000 (17:48 +0000)]
Fix additional issues pointed out in PR4088.

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

15 years agoccc-analyzer: Don't automatically generate 'Parser Rejects' files anymore. The
Ted Kremenek [Tue, 28 Apr 2009 17:37:44 +0000 (17:37 +0000)]
ccc-analyzer: Don't automatically generate 'Parser Rejects' files anymore. The
frontend is far enough along that most discrepancies between Clang and GCC are
(at least for C and Objective-C) are intentional. We also now have codegen to
test the frontend.

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

15 years agoUpdate analyzer build.
Ted Kremenek [Tue, 28 Apr 2009 14:32:50 +0000 (14:32 +0000)]
Update analyzer build.

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

15 years agoAdd test case.
Zhongxing Xu [Tue, 28 Apr 2009 13:52:13 +0000 (13:52 +0000)]
Add test case.

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

15 years agoNow we can remove the 'blast-through' code.
Zhongxing Xu [Tue, 28 Apr 2009 13:49:42 +0000 (13:49 +0000)]
Now we can remove the 'blast-through' code.

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

15 years agoImprove compatibility with GCC regarding inline semantics in GNU89
Douglas Gregor [Tue, 28 Apr 2009 06:37:30 +0000 (06:37 +0000)]
Improve compatibility with GCC regarding inline semantics in GNU89
mode and in the presence of __gnu_inline__ attributes. This should fix
both PR3989 and PR4069.

As part of this, we now keep track of all of the attributes attached
to each declaration even after we've performed declaration
merging. This fixes PR3264.

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

15 years agoExtensive diagnostics: Do not add a location context for do...while statements.
Ted Kremenek [Tue, 28 Apr 2009 04:28:12 +0000 (04:28 +0000)]
Extensive diagnostics: Do not add a location context for do...while statements.

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

15 years agoBugReporter (extensive diagnostics): Clean up do...while control-flow edges, and
Ted Kremenek [Tue, 28 Apr 2009 04:23:15 +0000 (04:23 +0000)]
BugReporter (extensive diagnostics): Clean up do...while control-flow edges, and
add "Looping back to the head of the loop" diagnostic for loops.

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

15 years agoCFG: Add "loop back" block for do...while statements.
Ted Kremenek [Tue, 28 Apr 2009 04:22:00 +0000 (04:22 +0000)]
CFG: Add "loop back" block for do...while statements.

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

15 years agoEmit keyword extension warning in all modes, not just C99 mode.
Eli Friedman [Tue, 28 Apr 2009 03:59:15 +0000 (03:59 +0000)]
Emit keyword extension warning in all modes, not just C99 mode.

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

15 years agoRemove unused LangOptions NoExtensions and Boolean.
Eli Friedman [Tue, 28 Apr 2009 03:28:55 +0000 (03:28 +0000)]
Remove unused LangOptions NoExtensions and Boolean.

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

15 years agoSimplify the scheme used for keywords, and change the classification
Eli Friedman [Tue, 28 Apr 2009 03:13:54 +0000 (03:13 +0000)]
Simplify the scheme used for keywords, and change the classification
scheme to be more useful.

The new scheme introduces a set of categories that should be more
readable, and also reflects what we want to consider as an extension
more accurately.  Specifically, it makes the "what is a keyword"
determination accurately reflect whether the keyword is a GNU or
Microsoft extension.

I also introduced separate flags for keyword aliases; this is useful
because the classification of the aliases is mostly unrelated to the
classification of the original keyword.

This patch treats anything that's in the implementation
namespace (prefixed with "__", or "_X" where "X" is any upper-case
letter) as a keyword without marking it as an extension.  This is
consistent with the standards in that an implementation is allowed to define
arbitrary extensions in the implementation namespace without violating
the standard. This gets rid of all the nasty "extension used" warnings
for stuff like __attribute__ in -pedantic mode.  We still warn for
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we
could add additional information to the keyword table.

This also removes processing for the unused "Boolean" language option;
such an extension isn't supported on any other C implementation, so I
don't see any point to adding it.

The changes to test/CodeGen/inline.c are required because previously, we
weren't actually disabling the "inline" keyword in -std=c89 mode.

I'll remove Boolean and NoExtensions from LangOptions in a follow-up
commit.

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

15 years agoCFG: 'WhileStmts' needs an extra block to indicate the "loop back" path.
Ted Kremenek [Tue, 28 Apr 2009 03:09:44 +0000 (03:09 +0000)]
CFG: 'WhileStmts' needs an extra block to indicate the "loop back" path.

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

15 years agoWe avoid the count of diagnostics when not generating carent
Mike Stump [Tue, 28 Apr 2009 01:19:10 +0000 (01:19 +0000)]
We avoid the count of diagnostics when not generating carent
diagnostics to improve gcc compatibility; useful for dejagnu testing.

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

15 years agoDon't allow blocks to be declared as returning an array. Radar 6441502
Mike Stump [Tue, 28 Apr 2009 01:10:27 +0000 (01:10 +0000)]
Don't allow blocks to be declared as returning an array.  Radar 6441502

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

15 years agoCFG:
Ted Kremenek [Tue, 28 Apr 2009 00:51:56 +0000 (00:51 +0000)]
CFG:
- Add 'LoopTarget' pointer field to CFGBlock. This records if the block is used
  as the 'loop back' path back to the head of a loop.
- For ForStmt, encode the loop back target as the increment code.

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

15 years agoGet rid of some useless uses of NoExtensions. The philosophy here is
Eli Friedman [Tue, 28 Apr 2009 00:51:18 +0000 (00:51 +0000)]
Get rid of some useless uses of NoExtensions.  The philosophy here is
that if we're going to print an extension warning anyway,
there's no point to changing behavior based on NoExtensions: it will
only make error recovery worse.

Note that this doesn't cause any behavior change because NoExtensions
isn't used by the current front-end.  I'm still considering what to do about
the remaining use of NoExtensions in IdentifierTable.cpp.

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

15 years agoA couple more small changes which are probably required for Cygwin
Eli Friedman [Mon, 27 Apr 2009 23:43:36 +0000 (23:43 +0000)]
A couple more small changes which are probably required for Cygwin
builds to work (PR4088).

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

15 years agoAttempt to fix reported build error on Cygwin, PR4088.
Eli Friedman [Mon, 27 Apr 2009 23:36:17 +0000 (23:36 +0000)]
Attempt to fix reported build error on Cygwin, PR4088.

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

15 years agoWhile generating debug info ignore unnamed fields.
Devang Patel [Mon, 27 Apr 2009 22:40:36 +0000 (22:40 +0000)]
While generating debug info ignore unnamed fields.

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

15 years agoAdd a header containing the Clang version; make the driver use this
Douglas Gregor [Mon, 27 Apr 2009 22:23:34 +0000 (22:23 +0000)]
Add a header containing the Clang version; make the driver use this
Clang version value rather than hard-coding "1.0".

Add PCH and Clang version information into the PCH file. Reject PCH
files with the wrong version information.

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

15 years agofix test/PCH/method_pool.m
Chris Lattner [Mon, 27 Apr 2009 22:17:41 +0000 (22:17 +0000)]
fix test/PCH/method_pool.m

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

15 years ago-E, -Eonly and -parse-noop now work with PCH!
Chris Lattner [Mon, 27 Apr 2009 22:02:30 +0000 (22:02 +0000)]
-E, -Eonly and -parse-noop now work with PCH!

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

15 years agoTeach PCH that ASTContext is optional. Move -parse-noop and -Eonly (so far)
Chris Lattner [Mon, 27 Apr 2009 21:45:14 +0000 (21:45 +0000)]
Teach PCH that ASTContext is optional.  Move -parse-noop and -Eonly (so far)
processing to after PCH is loaded.  -Eonly and -parse-noop are close to working
with PCH now but are not quite there yet.

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

15 years agoTrack down return statements in the handlers of a function-try-block of constructors...
Sebastian Redl [Mon, 27 Apr 2009 21:33:24 +0000 (21:33 +0000)]
Track down return statements in the handlers of a function-try-block of constructors. Meh ...

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

15 years agoBe more careful in our teardown of the PCHReader after deciding to
Douglas Gregor [Mon, 27 Apr 2009 21:28:04 +0000 (21:28 +0000)]
Be more careful in our teardown of the PCHReader after deciding to
ignore a PCH file.

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

15 years agounnest some code, decoupling fixit rewriting from ast stuff.
Chris Lattner [Mon, 27 Apr 2009 21:25:27 +0000 (21:25 +0000)]
unnest some code, decoupling fixit rewriting from ast stuff.

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

15 years agoAdd -empty-input-only option, for timing.
Daniel Dunbar [Mon, 27 Apr 2009 21:19:07 +0000 (21:19 +0000)]
Add -empty-input-only option, for timing.
 - Forces input file to be empty to time startup/shutdown costs.

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

15 years agoDon't allow catch declarations to name an abstract class
Sebastian Redl [Mon, 27 Apr 2009 21:03:30 +0000 (21:03 +0000)]
Don't allow catch declarations to name an abstract class

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

15 years agoImprove validation of C++ exception handling: diagnose throwing incomplete types...
Sebastian Redl [Mon, 27 Apr 2009 20:27:31 +0000 (20:27 +0000)]
Improve validation of C++ exception handling: diagnose throwing incomplete types and jumps into protected try-catch scopes.

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

15 years agoAdd Sema::ExtVectorDecls and Sema::ObjCCategoryImpls to the PCH file. Since these...
Douglas Gregor [Mon, 27 Apr 2009 20:06:05 +0000 (20:06 +0000)]
Add Sema::ExtVectorDecls and Sema::ObjCCategoryImpls to the PCH file. Since these vectors are very, very rarely used and, when used in headers, and even when used are relatively small, we load them eagerly.

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

15 years agoAdd two new checker-specific attributes: 'objc_ownership_release' and
Ted Kremenek [Mon, 27 Apr 2009 19:36:56 +0000 (19:36 +0000)]
Add two new checker-specific attributes: 'objc_ownership_release' and
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.

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

15 years agoTrack objects in GC mode returned by 'alloc', 'new', etc. methods. These are
Ted Kremenek [Mon, 27 Apr 2009 19:14:45 +0000 (19:14 +0000)]
Track objects in GC mode returned by 'alloc', 'new', etc. methods. These are
treated as "not owned" objects.

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

15 years agomake these be unsigned now that they are eagerly created.
Chris Lattner [Mon, 27 Apr 2009 19:03:22 +0000 (19:03 +0000)]
make these be unsigned now that they are eagerly created.

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

15 years agoshrink SOURCE_LOCATION_OFFSETS to use 4-byte entries instead of 8-byte
Chris Lattner [Mon, 27 Apr 2009 19:01:47 +0000 (19:01 +0000)]
shrink SOURCE_LOCATION_OFFSETS to use 4-byte entries instead of 8-byte
entries, shaving 100K off the PCH file for cocoa.

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

15 years agoFix a problem with the RUN line of one of the PCH tests
Douglas Gregor [Mon, 27 Apr 2009 18:49:47 +0000 (18:49 +0000)]
Fix a problem with the RUN line of one of the PCH tests

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

15 years agoRefactor HandleObjCOwnershipRetainAttr and HandleObjCOwnershipCFRetainAttr into
Ted Kremenek [Mon, 27 Apr 2009 18:41:18 +0000 (18:41 +0000)]
Refactor HandleObjCOwnershipRetainAttr and HandleObjCOwnershipCFRetainAttr into
HandleObjCOwnershipParmAttr. No functionality change (hopefully).

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

15 years agoImplement caching of stat() calls for precompiled headers, which is
Douglas Gregor [Mon, 27 Apr 2009 18:38:38 +0000 (18:38 +0000)]
Implement caching of stat() calls for precompiled headers, which is
essentially the same thing we do with pretokenized headers. stat()
caching improves performance of the Cocoa-prefixed "Hello, World" by
45%.

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

15 years agox86-32 ABI: Fix crash on return of structure with flexible array
Daniel Dunbar [Mon, 27 Apr 2009 18:31:32 +0000 (18:31 +0000)]
x86-32 ABI: Fix crash on return of structure with flexible array
member.

Also, spell bitfield more consistently as bit-field.

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

15 years agoAdd new checker-specific attribute 'objc_ownership_cfretain'. This is the same
Ted Kremenek [Mon, 27 Apr 2009 18:27:22 +0000 (18:27 +0000)]
Add new checker-specific attribute 'objc_ownership_cfretain'. This is the same
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).

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

15 years agoFill in the C++ status table for exceptions
Sebastian Redl [Mon, 27 Apr 2009 18:25:15 +0000 (18:25 +0000)]
Fill in the C++ status table for exceptions

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

15 years agoencode the type and decl offsets with 32-bits for entry instead
Chris Lattner [Mon, 27 Apr 2009 18:24:17 +0000 (18:24 +0000)]
encode the type and decl offsets with 32-bits for entry instead
of 64 bits.  This cuts 400KB off the PCH file for cocoa (7.1 ->
6.7MB):

Before:

Record Histogram:
  Count    # Bits   % Abv  Record Kind
      1     14296          SOURCE_LOCATION_PRELOADS
      1   1699598  100.00  SOURCE_LOCATION_OFFSETS
      1   1870766  100.00  METHOD_POOL
      1    212988  100.00  SELECTOR_OFFSETS
      1        88          STATISTICS
      1       106          SPECIAL_TYPES
      1  18033788  100.00  IDENTIFIER_TABLE
      1   1806428  100.00  IDENTIFIER_OFFSET
      1       170  100.00  TARGET_TRIPLE
      1       268          LANGUAGE_OPTIONS
      1   5168252  100.00  DECL_OFFSET
      1    952700  100.00  TYPE_OFFSET

After:

Record Histogram:
  Count    # Bits   % Abv  Record Kind
      1     14296          SOURCE_LOCATION_PRELOADS
      1   1699598  100.00  SOURCE_LOCATION_OFFSETS
      1   1870766  100.00  METHOD_POOL
      1    212988  100.00  SELECTOR_OFFSETS
      1        88          STATISTICS
      1       106          SPECIAL_TYPES
      1  18033788  100.00  IDENTIFIER_TABLE
      1   1806428  100.00  IDENTIFIER_OFFSET
      1       170  100.00  TARGET_TRIPLE
      1       268          LANGUAGE_OPTIONS
      1   2584156  100.00  DECL_OFFSET
      1    476380  100.00  TYPE_OFFSET

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

15 years agoadd an abbreviation for common PARM_VAR_DECL. All but 9 of the
Chris Lattner [Mon, 27 Apr 2009 07:35:58 +0000 (07:35 +0000)]
add an abbreviation for common PARM_VAR_DECL.  All but 9 of the
parm var decls in leopard cocoa.h end up using this abbreviation,
which shrinks the bitcode file by about 50K: 7217736->7167120.

Before:
  Block ID #12 (DECLS_BLOCK):
      Num Instances: 1
         Total Size: 2.23595e+07b/2.79494e+06B/698736W
          % of file: 38.7233
      Num SubBlocks: 0
        Num Abbrevs: 0
        Num Records: 139387
      % Abbrev Recs: 0

After:
  Block ID #12 (DECLS_BLOCK):
      Num Instances: 1
         Total Size: 2.02405e+07b/2.53006e+06B/632516W
          % of file: 35.301
      Num SubBlocks: 0
        Num Abbrevs: 1
        Num Records: 139387
      % Abbrev Recs: 19.2902

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

15 years agofix a couple more places that should be using the DeclCursor instead
Chris Lattner [Mon, 27 Apr 2009 07:35:40 +0000 (07:35 +0000)]
fix a couple more places that should be using the DeclCursor instead
of the normal stream cursor.

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

15 years agoLoad most of the source manager's information lazily from the PCH
Douglas Gregor [Mon, 27 Apr 2009 06:38:32 +0000 (06:38 +0000)]
Load most of the source manager's information lazily from the PCH
file. In particular, only eagerly load source location entries for
files and for the predefines buffer. Other buffers and
macro-instantiation source location entries are loaded lazily.

With the Cocoa-prefixed "Hello, World", we only load 815/26555 source
location entities. This halves the amount of user time we spend in
this "Hello, World" program with -fsyntax-only (down to .007s).

This optimization is part 1 of 2 for the source manager. This
eliminates most of the user time in loading a PCH file. We still spend
too much time initialize File structures (especially in the calls to
stat), so we need to either make the loading of source location
entries for files lazy or import the stat cache from the PTH
implementation.

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

15 years agosplit expr/stmt writing out to PCHWriterStmt.cpp
Chris Lattner [Mon, 27 Apr 2009 06:20:01 +0000 (06:20 +0000)]
split expr/stmt writing out to PCHWriterStmt.cpp

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

15 years agosplit decl writing out to its own PCHWriterDecl.cpp file.
Chris Lattner [Mon, 27 Apr 2009 06:16:06 +0000 (06:16 +0000)]
split decl writing out to its own PCHWriterDecl.cpp file.

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

15 years agounclone SavedStreamPosition
Chris Lattner [Mon, 27 Apr 2009 06:03:19 +0000 (06:03 +0000)]
unclone SavedStreamPosition

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

15 years agomove attribute reading to PCHReaderDecl.cpp, remove some
Chris Lattner [Mon, 27 Apr 2009 06:01:06 +0000 (06:01 +0000)]
move attribute reading to PCHReaderDecl.cpp, remove some
extraneous braces.

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

15 years agoread all decls (and attributes and stmts/exprs referenced by the decl)
Chris Lattner [Mon, 27 Apr 2009 05:58:23 +0000 (05:58 +0000)]
read all decls (and attributes and stmts/exprs referenced by the decl)
from the DeclsCursor.

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

15 years agorename GetStmt -> GetDeclStmt to make it clear that the stmt read
Chris Lattner [Mon, 27 Apr 2009 05:46:25 +0000 (05:46 +0000)]
rename GetStmt -> GetDeclStmt to make it clear that the stmt read
is part of a decl.

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

15 years agochange the interface to ReadStmt to force clients to pass a cursor in to read from.
Chris Lattner [Mon, 27 Apr 2009 05:41:06 +0000 (05:41 +0000)]
change the interface to ReadStmt to force clients to pass a cursor in to read from.

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

15 years agosplit decl reading out to its own PCHReaderDecl.cpp file.
Chris Lattner [Mon, 27 Apr 2009 05:27:42 +0000 (05:27 +0000)]
split decl reading out to its own PCHReaderDecl.cpp file.

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

15 years agosplit stmt/expr deserialization out to PCHReaderStmt.cpp
Chris Lattner [Mon, 27 Apr 2009 05:14:47 +0000 (05:14 +0000)]
split stmt/expr deserialization out to PCHReaderStmt.cpp

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

15 years agordar://6827200 - [sema] reject statically allocated arrays of interface types
Chris Lattner [Mon, 27 Apr 2009 01:55:56 +0000 (01:55 +0000)]
rdar://6827200 - [sema] reject statically allocated arrays of interface types

Upgrade "array of interface" warning to an error.  In addition to being a
terrible idea, this crashes codegen.

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

15 years agoChange our silencing of C typedef redefinition handling to what we had
Chris Lattner [Mon, 27 Apr 2009 01:46:12 +0000 (01:46 +0000)]
Change our silencing of C typedef redefinition handling to what we had
before r69391: typedef redefinition is an error by default, but if
*either* the old or new definition are from a system header, we silence
it.

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

15 years agoremove dead var
Chris Lattner [Mon, 27 Apr 2009 01:08:03 +0000 (01:08 +0000)]
remove dead var

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

15 years agoSet up DeclsCursor.
Chris Lattner [Mon, 27 Apr 2009 01:05:14 +0000 (01:05 +0000)]
Set up DeclsCursor.

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

15 years agoadd stmt/expr names to BlockInfo block.
Chris Lattner [Mon, 27 Apr 2009 00:49:53 +0000 (00:49 +0000)]
add stmt/expr names to BlockInfo block.

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

15 years agofix a comment by starting stmts/exprs after types and decls.
Chris Lattner [Mon, 27 Apr 2009 00:44:11 +0000 (00:44 +0000)]
fix a comment by starting stmts/exprs after types and decls.

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

15 years agomake -Wtypedef-redefinition an extwarn instead of defaulting
Chris Lattner [Mon, 27 Apr 2009 00:41:01 +0000 (00:41 +0000)]
make -Wtypedef-redefinition an extwarn instead of defaulting
to error, doing this breaks too many programs (e.g. Adium).

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

15 years agodrop the _ID suffixes from block names.
Chris Lattner [Mon, 27 Apr 2009 00:40:25 +0000 (00:40 +0000)]
drop the _ID suffixes from block names.

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

15 years agoTurn PCH off by default, yet again. I'm happier about it this time, though
Douglas Gregor [Sun, 26 Apr 2009 23:15:05 +0000 (23:15 +0000)]
Turn PCH off by default, yet again. I'm happier about it this time, though

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

15 years agoadd the decl names.
Chris Lattner [Sun, 26 Apr 2009 22:32:16 +0000 (22:32 +0000)]
add the decl names.

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

15 years agomake llvm-bcanalyzer dump out PCH files symbolically. We should probably
Chris Lattner [Sun, 26 Apr 2009 22:26:21 +0000 (22:26 +0000)]
make llvm-bcanalyzer dump out PCH files symbolically.  We should probably
eventually get an option to turn this off, but it is nice for looking at
statistics.  For example, the types block now prints:

  Block ID #11 (TYPES_BLOCK_ID):
      Num Instances: 1
         Total Size: 895100b/111888B/27971.9W
          % of file: 1.55801
      Num SubBlocks: 0
        Num Abbrevs: 0
        Num Records: 14899
      % Abbrev Recs: 0

        Code Histogram:
                5478    TYPE_FUNCTION_PROTO
                2683    TYPE_TYPEDEF
                2460    TYPE_POINTER
                2047    TYPE_ENUM
                1553    TYPE_RECORD
                283     TYPE_CONSTANT_ARRAY
                274     TYPE_OBJC_INTERFACE
                76      TYPE_INCOMPLETE_ARRAY
                10      TYPE_VECTOR
                9       TYPE_OBJC_QUALIFIED_ID
                5       TYPE_FUNCTION_NO_PROTO
                5       TYPE_EXT_QUAL
                3       TYPE_TYPEOF_EXPR

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

15 years agoTrying turning on PCH by default yet again. We might actually a chance at success now
Douglas Gregor [Sun, 26 Apr 2009 22:21:26 +0000 (22:21 +0000)]
Trying turning on PCH by default yet again. We might actually a chance at success now

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

15 years agoSome fixes for PCH (de-)serialization of Objective-C AST nodes:
Douglas Gregor [Sun, 26 Apr 2009 22:20:50 +0000 (22:20 +0000)]
Some fixes for PCH (de-)serialization of Objective-C AST nodes:
  - Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
  - Implement PCH support for ImplicitParamDecl
  - Fix the handling of the body of an ObjCMethodDecl
  - Several cast -> cast_or_null fixes
  - Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
  selectors.
  - Make Selector::getAsString() work with NULL selectors.
  - Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
  in the PCH reader and writer; these were never getting called.

At this point, all of the pch-test tests pass for C and Objective-C.

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

15 years agoAdd a bit more handling for declarations like "int a[*]".
Eli Friedman [Sun, 26 Apr 2009 21:57:51 +0000 (21:57 +0000)]
Add a bit more handling for declarations like "int a[*]".

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

15 years agoThe mysterious bug turns out to be an incredibly bone-headed mistake.
Sebastian Redl [Sun, 26 Apr 2009 21:08:36 +0000 (21:08 +0000)]
The mysterious bug turns out to be an incredibly bone-headed mistake.

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