Commit Graph

12519 Commits

Author SHA1 Message Date
Ted Kremenek 49936f76ec CFG: 'WhileStmts' needs an extra block to indicate the "loop back" path.
llvm-svn: 70280
2009-04-28 03:09:44 +00:00
Mike Stump 6ea352a750 We avoid the count of diagnostics when not generating carent
diagnostics to improve gcc compatibility; useful for dejagnu testing.

llvm-svn: 70278
2009-04-28 01:19:10 +00:00
Mike Stump d456c48568 Don't allow blocks to be declared as returning an array. Radar 6441502
llvm-svn: 70277
2009-04-28 01:10:27 +00:00
Ted Kremenek 902393b4b7 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.

llvm-svn: 70274
2009-04-28 00:51:56 +00:00
Eli Friedman 5d72d41189 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.

llvm-svn: 70273
2009-04-28 00:51:18 +00:00
Eli Friedman f66a2e12a4 A couple more small changes which are probably required for Cygwin
builds to work (PR4088).

llvm-svn: 70269
2009-04-27 23:43:36 +00:00
Eli Friedman a90db0acd0 Attempt to fix reported build error on Cygwin, PR4088.
llvm-svn: 70268
2009-04-27 23:36:17 +00:00
Devang Patel df348f10b6 While generating debug info ignore unnamed fields.
llvm-svn: 70266
2009-04-27 22:40:36 +00:00
Douglas Gregor 7b71e63120 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.

llvm-svn: 70264
2009-04-27 22:23:34 +00:00
Chris Lattner 1d72888cfc fix test/PCH/method_pool.m
llvm-svn: 70263
2009-04-27 22:17:41 +00:00
Chris Lattner 8804f40321 -E, -Eonly and -parse-noop now work with PCH!
llvm-svn: 70259
2009-04-27 22:02:30 +00:00
Chris Lattner 8575daaa82 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.

llvm-svn: 70257
2009-04-27 21:45:14 +00:00
Sebastian Redl 4c018663b2 Track down return statements in the handlers of a function-try-block of constructors. Meh ...
llvm-svn: 70256
2009-04-27 21:33:24 +00:00
Douglas Gregor 0bc1293584 Be more careful in our teardown of the PCHReader after deciding to
ignore a PCH file.

llvm-svn: 70251
2009-04-27 21:28:04 +00:00
Chris Lattner 1f1e1c7e39 unnest some code, decoupling fixit rewriting from ast stuff.
llvm-svn: 70250
2009-04-27 21:25:27 +00:00
Daniel Dunbar c6480e2634 Add -empty-input-only option, for timing.
- Forces input file to be empty to time startup/shutdown costs.

llvm-svn: 70249
2009-04-27 21:19:07 +00:00
Sebastian Redl 2f38ba57c8 Don't allow catch declarations to name an abstract class
llvm-svn: 70248
2009-04-27 21:03:30 +00:00
Sebastian Redl 4de47b445b Improve validation of C++ exception handling: diagnose throwing incomplete types and jumps into protected try-catch scopes.
llvm-svn: 70242
2009-04-27 20:27:31 +00:00
Douglas Gregor 61cac2b295 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.
llvm-svn: 70240
2009-04-27 20:06:05 +00:00
Ted Kremenek 84bfa2c2dc 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.

llvm-svn: 70235
2009-04-27 19:36:56 +00:00
Ted Kremenek e6633567e0 Track objects in GC mode returned by 'alloc', 'new', etc. methods. These are
treated as "not owned" objects.

llvm-svn: 70232
2009-04-27 19:14:45 +00:00
Chris Lattner c4976c7377 make these be unsigned now that they are eagerly created.
llvm-svn: 70229
2009-04-27 19:03:22 +00:00
Chris Lattner 12d61d3253 shrink SOURCE_LOCATION_OFFSETS to use 4-byte entries instead of 8-byte
entries, shaving 100K off the PCH file for cocoa.

llvm-svn: 70228
2009-04-27 19:01:47 +00:00
Douglas Gregor 988e627f8c Fix a problem with the RUN line of one of the PCH tests
llvm-svn: 70227
2009-04-27 18:49:47 +00:00
Ted Kremenek 5fbe183ce0 Refactor HandleObjCOwnershipRetainAttr and HandleObjCOwnershipCFRetainAttr into
HandleObjCOwnershipParmAttr. No functionality change (hopefully).

llvm-svn: 70224
2009-04-27 18:41:18 +00:00
Douglas Gregor c504683237 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%.

llvm-svn: 70223
2009-04-27 18:38:38 +00:00
Daniel Dunbar 01910a50c4 x86-32 ABI: Fix crash on return of structure with flexible array
member.

Also, spell bitfield more consistently as bit-field.

llvm-svn: 70220
2009-04-27 18:31:32 +00:00
Ted Kremenek ebbef7d0d3 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).

llvm-svn: 70218
2009-04-27 18:27:22 +00:00
Sebastian Redl 21b349d5ea Fill in the C++ status table for exceptions
llvm-svn: 70217
2009-04-27 18:25:15 +00:00
Chris Lattner eeb0569b5a 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

llvm-svn: 70216
2009-04-27 18:24:17 +00:00
Chris Lattner 258172e78d 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

llvm-svn: 70199
2009-04-27 07:35:58 +00:00
Chris Lattner 72405d6ec2 fix a couple more places that should be using the DeclCursor instead
of the normal stream cursor.

llvm-svn: 70198
2009-04-27 07:35:40 +00:00
Douglas Gregor 258ae54a5d 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.

llvm-svn: 70196
2009-04-27 06:38:32 +00:00
Chris Lattner 1f55182459 split expr/stmt writing out to PCHWriterStmt.cpp
llvm-svn: 70194
2009-04-27 06:20:01 +00:00
Chris Lattner 7099dbc5bc split decl writing out to its own PCHWriterDecl.cpp file.
llvm-svn: 70193
2009-04-27 06:16:06 +00:00
Chris Lattner 9df8a73328 unclone SavedStreamPosition
llvm-svn: 70192
2009-04-27 06:03:19 +00:00
Chris Lattner 8f63ab5385 move attribute reading to PCHReaderDecl.cpp, remove some
extraneous braces.

llvm-svn: 70191
2009-04-27 06:01:06 +00:00
Chris Lattner 1de76db762 read all decls (and attributes and stmts/exprs referenced by the decl)
from the DeclsCursor.

llvm-svn: 70190
2009-04-27 05:58:23 +00:00
Chris Lattner 9c28af0cc5 rename GetStmt -> GetDeclStmt to make it clear that the stmt read
is part of a decl.

llvm-svn: 70189
2009-04-27 05:46:25 +00:00
Chris Lattner f4262539fa change the interface to ReadStmt to force clients to pass a cursor in to read from.
llvm-svn: 70188
2009-04-27 05:41:06 +00:00
Chris Lattner 487412d4db split decl reading out to its own PCHReaderDecl.cpp file.
llvm-svn: 70187
2009-04-27 05:27:42 +00:00
Chris Lattner 92ba5ffdfe split stmt/expr deserialization out to PCHReaderStmt.cpp
llvm-svn: 70186
2009-04-27 05:14:47 +00:00
Chris Lattner 669e32f8c0 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.

llvm-svn: 70178
2009-04-27 01:55:56 +00:00
Chris Lattner 9a84589671 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.

llvm-svn: 70177
2009-04-27 01:46:12 +00:00
Chris Lattner 6ab8142cb2 remove dead var
llvm-svn: 70174
2009-04-27 01:08:03 +00:00
Chris Lattner e78a6bec89 Set up DeclsCursor.
llvm-svn: 70173
2009-04-27 01:05:14 +00:00
Chris Lattner ccac3a611a add stmt/expr names to BlockInfo block.
llvm-svn: 70172
2009-04-27 00:49:53 +00:00
Chris Lattner 94b38c0ff2 fix a comment by starting stmts/exprs after types and decls.
llvm-svn: 70171
2009-04-27 00:44:11 +00:00
Chris Lattner 35cfb0544a make -Wtypedef-redefinition an extwarn instead of defaulting
to error, doing this breaks too many programs (e.g. Adium).

llvm-svn: 70170
2009-04-27 00:41:01 +00:00
Chris Lattner 6403198468 drop the _ID suffixes from block names.
llvm-svn: 70169
2009-04-27 00:40:25 +00:00