summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* split expr/stmt writing out to PCHWriterStmt.cppChris Lattner2009-04-273-799/+822
| | | | llvm-svn: 70194
* split decl writing out to its own PCHWriterDecl.cpp file.Chris Lattner2009-04-273-445/+470
| | | | llvm-svn: 70193
* unclone SavedStreamPositionChris Lattner2009-04-272-35/+0
| | | | llvm-svn: 70192
* move attribute reading to PCHReaderDecl.cpp, remove someChris Lattner2009-04-272-212/+165
| | | | | | extraneous braces. llvm-svn: 70191
* read all decls (and attributes and stmts/exprs referenced by the decl)Chris Lattner2009-04-273-24/+25
| | | | | | from the DeclsCursor. llvm-svn: 70190
* rename GetStmt -> GetDeclStmt to make it clear that the stmt readChris Lattner2009-04-271-1/+6
| | | | | | is part of a decl. llvm-svn: 70189
* change the interface to ReadStmt to force clients to pass a cursor in to ↵Chris Lattner2009-04-273-18/+18
| | | | | | read from. llvm-svn: 70188
* split decl reading out to its own PCHReaderDecl.cpp file.Chris Lattner2009-04-273-585/+629
| | | | llvm-svn: 70187
* split stmt/expr deserialization out to PCHReaderStmt.cppChris Lattner2009-04-273-1114/+1150
| | | | llvm-svn: 70186
* remove dead varChris Lattner2009-04-271-1/+0
| | | | llvm-svn: 70174
* Set up DeclsCursor.Chris Lattner2009-04-271-1/+35
| | | | llvm-svn: 70173
* add stmt/expr names to BlockInfo block.Chris Lattner2009-04-271-3/+77
| | | | llvm-svn: 70172
* drop the _ID suffixes from block names.Chris Lattner2009-04-271-6/+6
| | | | llvm-svn: 70169
* add the decl names.Chris Lattner2009-04-261-2/+26
| | | | llvm-svn: 70167
* make llvm-bcanalyzer dump out PCH files symbolically. We should probablyChris Lattner2009-04-261-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 70166
* Some fixes for PCH (de-)serialization of Objective-C AST nodes:Douglas Gregor2009-04-262-26/+47
| | | | | | | | | | | | | | | | - 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. llvm-svn: 70163
* Adjust to LLVM API changes that went into r70157.Chris Lattner2009-04-261-6/+7
| | | | llvm-svn: 70158
* Add PCH read/write support for ObjC statements.Steve Naroff2009-04-262-1/+130
| | | | llvm-svn: 70143
* Make sure we have a code in the node:-)Steve Naroff2009-04-261-0/+4
| | | | | | This fixes all the -emit-pch problems discovered by utils/pch-test.pl. llvm-svn: 70125
* When writing a PCH file, write multiple type and declaration blocks asDouglas Gregor2009-04-262-12/+22
| | | | | | | | | | | 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. llvm-svn: 70109
* split ObjC and C++ Statements out into their own headers.Chris Lattner2009-04-261-1/+0
| | | | llvm-svn: 70105
* implement PCH support for the rest of ExprObjC.h, includingChris Lattner2009-04-262-7/+104
| | | | | | the missing bits of ObjCMessageExpr. llvm-svn: 70100
* Don't read all of the records in the PCH file's preprocessor block,Douglas Gregor2009-04-262-111/+46
| | | | | | | | | | | | most of which are ignored. Instead, move the __COUNTER__ value out to a PCH-level record (since it is handled eagerly) and move the header file information into the SourceManager block (which is also, currently, loaded eagerly). This results in another 17% performance improvement in the Cocoa-prefixed "Hello, World" with PCH. llvm-svn: 70097
* Lazily load the controlling macros for all of the headers known in theDouglas Gregor2009-04-251-1/+2
| | | | | | | | PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes us from reading 503 identifiers down to 37 and from 470 macros down to 4. It also results in an 8% performance improvement. llvm-svn: 70094
* Optimize the loading of an identifier from a PCH file when given theDouglas Gregor2009-04-251-17/+35
| | | | | | | | | | identifier's ID. In this case, we know where the identifier's entry is located in the hash table (it starts right before the identifier string itself), so skip the hash table lookup and read the entry directly. The performance improvement here is, gain, hard to quantify, but it's the right thing to do. llvm-svn: 70078
* PCH optimization for the identifier table, where we separateDouglas Gregor2009-04-252-5/+62
| | | | | | | | | | | | | | | "interesting" identifiers (e.g., those where the IdentifierInfo has some useful information) from "uninteresting" identifiers (where the IdentifierInfo is just a name). This makes the hash table smaller (so searching in it should be faster) and, when loading "uninteresting" identifiers, we skip the lookup in the hash table. PCH file size is slightly smaller than before (since we don't emit the contents of the uninteresting IdentifierInfo structures). The Cocoa.h-prefixed "Hello, World" doesn't show any speedup, although we're getting to the point where system noise is a bit issue. llvm-svn: 70075
* Revert my changes that try to avoid creating StringMap entries forDouglas Gregor2009-04-252-22/+4
| | | | | | | identifiers. They don't yet work, but will inhibit future optimizations. llvm-svn: 70071
* Start implementing the PTH IdentifierInfo-saving trick in PCH,Douglas Gregor2009-04-251-2/+14
| | | | | | | | | | | | | | | | | allocating IdentifierInfos with a pointer into the string data stored in the PCH file rather than having an entry in the identifier table's string map. However, we don't actually get these savings at the moment, because we go through the IdentifierTable when loading identifiers from the on-disk hash table. This commit is for record-keeping purposes only. I'll be reverting this change (and the PCH layout tweak that preceded it) because it appears that implementing this optimization will collide with another, future optimization to reduce the size of the on-disk hash table for identifiers. That optimization is likely to provide more benefit (with less voodoo). llvm-svn: 70070
* Tweak the data layout for the on-disk hash table of identifiers in the PCH ↵Douglas Gregor2009-04-252-2/+8
| | | | | | file so that the key layout matches that of the PTH key layout llvm-svn: 70066
* Write the identifier offsets array into the PCH file as a blob, soDouglas Gregor2009-04-252-42/+47
| | | | | | | | | | | | | | that the PCH reader does not have to decode the VBR encoding at PCH load time. Also, reduce the size of the identifier offsets from 64 bits down to 32 bits. The identifier table itself isn't going to grow to more than 4GB :) Overall, this results in a 13% speedup in the Cocoa-prefixed "Hello, World" benchmark. llvm-svn: 70063
* Write the declaration and type offset arrays into the bitstream asDouglas Gregor2009-04-252-36/+60
| | | | | | | | | | blobs, so that we don't need to do any work to get these arrays into memory at PCH load time. This gives another 19% performance improvement to the Cocoa-prefixed "Hello, World!". llvm-svn: 70059
* Load the selector table lazily from the PCH file. Douglas Gregor2009-04-252-152/+125
| | | | | | | | | | | | | | | | | | This results in a 10% speedup on the Cocoa-prefixed "Hello, World!", all of which is (not surprisingly) user time. There was a tiny reduction in the size of the PCH file for Cocoa.h, because certain selectors aren't being written twice. I'm using two new tricks here that I'd like to replicate elsewhere: (1) The selectors not used in the global method pool are packed into the blob after the global method pool's on-disk hash table and stored as keys, so that all selectors are in the same blob. (2) We record the offsets of each selector key when we write it into the global method pool (or after it, in the same blob). The offset table is written as a blob, so that we don't need to pack/unpack a SmallVector with its contents. llvm-svn: 70055
* Fix indexing error in PCHStmtReader::VisitArraySubscriptExpr().Steve Naroff2009-04-251-1/+1
| | | | llvm-svn: 70046
* Add PCH support for ObjCMessageExpr (needed to build Mail).Steve Naroff2009-04-252-0/+35
| | | | llvm-svn: 70044
* Fixup comment.Steve Naroff2009-04-251-1/+1
| | | | llvm-svn: 70040
* Fix a major bug in PCHReader::ReadSelectorBlock().Steve Naroff2009-04-252-7/+8
| | | | | | Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris. llvm-svn: 70039
* Make sure that the consumer sees all interested decls. This fixes PreviewDouglas Gregor2009-04-251-15/+26
| | | | llvm-svn: 70007
* Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked upTed Kremenek2009-04-252-0/+2
| | | | | | | | to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function increments the reference count of a passed object. llvm-svn: 70005
* When we de-serialize an Objective-C protocol, hand it to the AST consumer so ↵Douglas Gregor2009-04-241-0/+3
| | | | | | that we can create metadata llvm-svn: 70003
* Add new checker-specific attribute 'objc_ownership_returns'. This isn't hookedTed Kremenek2009-04-242-0/+2
| | | | | | | up to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function returns an owned an Objective-C object. llvm-svn: 70001
* Once the protocol list has been loaded from the PCH file, add it toDouglas Gregor2009-04-241-0/+1
| | | | | | the Objective-C interface. llvm-svn: 69993
* Fix two small but very nasty bugs in the PCH writer for method pools:Douglas Gregor2009-04-241-5/+10
| | | | | | | | | | | | (1) Make sure to pad on-disk hash tables with 4 bytes, not 2, since the reader assumes that bucket data is aligned on 4-byte boundaries. (2) Don't emit the number of factory methods twice. This was throwing off the data counts and therefore causing lookups to fail. I've added asserts so that this class of error cannot happen again. llvm-svn: 69991
* PCH support for the global method pool (= instance and factory methodDouglas Gregor2009-04-242-1/+307
| | | | | | | | pools, combined). The methods in the global method pool are lazily loaded from an on-disk hash table when Sema looks into its version of the hash tables. llvm-svn: 69989
* Add PCH support for #import.Steve Naroff2009-04-242-4/+33
| | | | llvm-svn: 69987
* Use cast_or_null instead of ternary operator (suggested by Doug).Steve Naroff2009-04-241-3/+1
| | | | llvm-svn: 69975
* Allow the next catoregory slot to be null.Steve Naroff2009-04-241-1/+3
| | | | llvm-svn: 69969
* Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's ↵Douglas Gregor2009-04-242-2/+2
| | | | | | | | | | | good for uniformity is good for PCH (or is it the other way around?). As part of this, make ObjCImplDecl inherit from NamedDecl (since ObjCImplementationDecls now need to have names so that they can be found). This brings ObjCImplDecl very, very close to ObjCContainerDecl; we may be able to merge them soon. llvm-svn: 69941
* Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls inDouglas Gregor2009-04-231-1/+1
| | | | | | | | | | | | their own namespace (IDNS_Protocol) and use the normal name-lookup routines to find them. Aside from the simplification this provides (one less DenseMap!), it means that protocols will be lazily deserialized from PCH files. Make the code size of the selector table block match the code size of the type and decl blocks. llvm-svn: 69939
* PCH support for categories in Objective-C interfaces.Douglas Gregor2009-04-232-3/+3
| | | | llvm-svn: 69933
* PCH support for all of the predefined Objective-C types, such as id,Douglas Gregor2009-04-232-1/+19
| | | | | | | | SEL, Class, Protocol, CFConstantString, and __objcFastEnumerationState. With this, we can now run the Objective-C methods and properties PCH tests. llvm-svn: 69932
OpenPOWER on IntegriCloud