]> granicus.if.org Git - clang/log
clang
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

15 years agoAdjust to LLVM API changes that went into r70157.
Chris Lattner [Sun, 26 Apr 2009 20:59:20 +0000 (20:59 +0000)]
Adjust to LLVM API changes that went into r70157.

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

15 years agoFix for PR4079: make sure to construct the member expressions for
Eli Friedman [Sun, 26 Apr 2009 20:50:44 +0000 (20:50 +0000)]
Fix for PR4079: make sure to construct the member expressions for
offsetof correctly in the presence of anonymous structs/unions.

This could definitely use some cleanup, but I don't really want to mess
with the anonymous union/struct code.

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

15 years agoImplement function-try-blocks. However, there's a very subtle bug that I can't track...
Sebastian Redl [Sun, 26 Apr 2009 20:35:05 +0000 (20:35 +0000)]
Implement function-try-blocks. However, there's a very subtle bug that I can't track down.

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

15 years agoRemove getIntegerConstantExprValue in favor of using EvaluateAsInt.
Eli Friedman [Sun, 26 Apr 2009 19:19:15 +0000 (19:19 +0000)]
Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.

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

15 years agoMinor code cleanup.
Eli Friedman [Sun, 26 Apr 2009 19:04:51 +0000 (19:04 +0000)]
Minor code cleanup.

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

15 years agoAdd PCH read/write support for ObjC statements.
Steve Naroff [Sun, 26 Apr 2009 18:52:16 +0000 (18:52 +0000)]
Add PCH read/write support for ObjC statements.

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

15 years agoimplement PR4077: [Linux kernel] inscrutable error on inline asm input/output constra...
Chris Lattner [Sun, 26 Apr 2009 18:22:24 +0000 (18:22 +0000)]
implement PR4077: [Linux kernel] inscrutable error on inline asm input/output constraint mismatch
Before we emitted:

$ clang t.c -S -m64
llvm: error: Unsupported asm: input constraint with a matching output constraint of incompatible type!

Now we produce:
$ clang t.c -S -m64
t.c:5:40: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'int'
  asm volatile("foo " : "=a" (a) :"0" (b));
                             ~~~      ~^~

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

15 years agoin a tied operand, don't copy over the name or constraint string, just the flags.
Chris Lattner [Sun, 26 Apr 2009 18:05:25 +0000 (18:05 +0000)]
in a tied operand, don't copy over the name or constraint string, just the flags.

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

15 years agopull operands names "[foo]" into ConstraintInfo.
Chris Lattner [Sun, 26 Apr 2009 17:57:12 +0000 (17:57 +0000)]
pull operands names "[foo]" into ConstraintInfo.

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

15 years agopull the constraint string into the ConstraintInfo struct
Chris Lattner [Sun, 26 Apr 2009 17:19:08 +0000 (17:19 +0000)]
pull the constraint string into the ConstraintInfo struct
instead of passing it around in addition to it.

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

15 years agoMake sure we have a code in the node:-)
Steve Naroff [Sun, 26 Apr 2009 14:11:39 +0000 (14:11 +0000)]
Make sure we have a code in the node:-)

This fixes all the -emit-pch problems discovered by utils/pch-test.pl.

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

15 years agoUpdate StmtNodes.def with the new base class of CXXTemporaryObjectExpr
Sebastian Redl [Sun, 26 Apr 2009 11:30:47 +0000 (11:30 +0000)]
Update StmtNodes.def with the new base class of CXXTemporaryObjectExpr

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

15 years agoMake reference class unification in conditional expressions check for validity of...
Sebastian Redl [Sun, 26 Apr 2009 11:21:02 +0000 (11:21 +0000)]
Make reference class unification in conditional expressions check for validity of the conversion.

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

15 years agoAdd missing include. This fixes the build with gcc 4.3.3.
Torok Edwin [Sun, 26 Apr 2009 07:50:14 +0000 (07:50 +0000)]
Add missing include. This fixes the build with gcc 4.3.3.

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

15 years agochange TargetInfo::ConstraintInfo to be a struct that contains
Chris Lattner [Sun, 26 Apr 2009 07:16:29 +0000 (07:16 +0000)]
change TargetInfo::ConstraintInfo to be a struct that contains
the enum along with some other data.

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

15 years agoTurn off PCH by default, again
Douglas Gregor [Sun, 26 Apr 2009 05:09:50 +0000 (05:09 +0000)]
Turn off PCH by default, again

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

15 years agoOne more crazy try with PCH-by-default
Douglas Gregor [Sun, 26 Apr 2009 03:59:49 +0000 (03:59 +0000)]
One more crazy try with PCH-by-default

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

15 years agoMake sure to pull in the target builtin records when initialize the AST context,...
Douglas Gregor [Sun, 26 Apr 2009 03:57:37 +0000 (03:57 +0000)]
Make sure to pull in the target builtin records when initialize the AST context, even if we're not going to initialize the __builin_* identifiers

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

15 years agoSimple little smoke-test script that tries to build PCH files and then
Douglas Gregor [Sun, 26 Apr 2009 03:52:11 +0000 (03:52 +0000)]
Simple little smoke-test script that tries to build PCH files and then
dump their contents for all of the compilable tests in Clang's
testsuite. All of the tests pass for C, but there are still many
failures for Objective-C.

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

15 years agoWhen writing a PCH file, write multiple type and declaration blocks as
Douglas Gregor [Sun, 26 Apr 2009 03:49:13 +0000 (03:49 +0000)]
When writing a PCH file, write multiple type and declaration blocks as
necessary and iterate until all types and declarations have been
written. This reduces the Cocoa.h PCH file size by about 4% (since we
don't write types we don't need), and fixes problems where writing a
declaration generates a new type.

This doesn't seem to have any impact on performance either way.

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

15 years agoAdd a new -ast-dump-full option that traverses the translation unit
Douglas Gregor [Sun, 26 Apr 2009 02:02:08 +0000 (02:02 +0000)]
Add a new -ast-dump-full option that traverses the translation unit
declaration rather than printing through the HandleTopLevelDecl
action. Using this, one can deserialize an entire PCH file and dump
it.

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

15 years agoSplit C++ statements out to their own file.
Chris Lattner [Sun, 26 Apr 2009 01:42:41 +0000 (01:42 +0000)]
Split C++ statements out to their own file.

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

15 years agoTurn of PCH by default. I got the info I was looking for
Douglas Gregor [Sun, 26 Apr 2009 01:34:47 +0000 (01:34 +0000)]
Turn of PCH by default. I got the info I was looking for

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

15 years agosplit ObjC and C++ Statements out into their own headers.
Chris Lattner [Sun, 26 Apr 2009 01:32:48 +0000 (01:32 +0000)]
split ObjC and C++ Statements out into their own headers.

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

15 years agoCorrect the order of the parameters to CheckAssignmentConstraints in
Eli Friedman [Sun, 26 Apr 2009 01:30:08 +0000 (01:30 +0000)]
Correct the order of the parameters to CheckAssignmentConstraints in
cleanup attribute checking.  The difference isn't normally visible, but it
can make a difference...

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

15 years agoMake this code a little more generic.
Daniel Dunbar [Sun, 26 Apr 2009 01:28:51 +0000 (01:28 +0000)]
Make this code a little more generic.

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

15 years agoDriver: Add -std-default= option.
Daniel Dunbar [Sun, 26 Apr 2009 01:10:38 +0000 (01:10 +0000)]
Driver: Add -std-default= option.
 - This can be used to supply a default value for -std=; the idea is
   that this can be used in conjunction with CCC_ADD_ARGS or
   QA_OVERRIDE_GCC3_OPTIONS to change the default without having to
   modify the build system.

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

15 years agoAdd option for AddAllArgsTranslated to control whether output argument
Daniel Dunbar [Sun, 26 Apr 2009 01:07:52 +0000 (01:07 +0000)]
Add option for AddAllArgsTranslated to control whether output argument
should be joined or separate.

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

15 years agoimplement PCH support for the rest of ExprObjC.h, including
Chris Lattner [Sun, 26 Apr 2009 00:44:05 +0000 (00:44 +0000)]
implement PCH support for the rest of ExprObjC.h, including
the missing bits of ObjCMessageExpr.

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

15 years agoAnother shot at switching PCH on by default, now that we've cleaned up some bugs...
Douglas Gregor [Sun, 26 Apr 2009 00:37:38 +0000 (00:37 +0000)]
Another shot at switching PCH on by default, now that we've cleaned up some bugs and improved performance. Will be reverted after Mr. Speedy gets done with it

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

15 years agoWhen calling the cleanup function specified by __attribute__((cleanup)), make sure...
Anders Carlsson [Sun, 26 Apr 2009 00:34:20 +0000 (00:34 +0000)]
When calling the cleanup function specified by __attribute__((cleanup)), make sure to bitcast the argument so it has the same type as the first argument of the cleanup function. Fixes <rdar://problem/6827047>.

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