summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also ↵Argyrios Kyrtzidis2010-08-131-10/+10
| | | | | | | | keeping track of unused file scoped variables. This is only preparation, currently only static function definitions are tracked, as before. llvm-svn: 111025
* Teach ASTUnit to hold on to the Sema object and ASTConsumer that areDouglas Gregor2010-08-131-8/+12
| | | | | | | | used when parsing (or re-parsing) a file. Also, when loading a precompiled header into ASTUnit, create a Sema object that holds onto semantic-analysis information. llvm-svn: 111003
* Instead of modifying the ObjC AST to not modify existing declarations, teach ↵Sebastian Redl2010-08-131-0/+11
| | | | | | chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is. llvm-svn: 110989
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-1/+1
| | | | llvm-svn: 110945
* -Make TokenID of IdentifierInfo read-only, remove setTokenID().Argyrios Kyrtzidis2010-08-111-1/+5
| | | | | | | | -There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility. To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods. Store the bitfield in PCH. llvm-svn: 110868
* Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do ↵Sebastian Redl2010-08-111-2/+2
| | | | | | with the breakage. llvm-svn: 110840
* Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,Douglas Gregor2010-08-111-2/+2
| | | | | | | | and create separate decl nodes for forward declarations and the definition," which appears to be causing significant Objective-C breakage. llvm-svn: 110803
* - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for ↵Sebastian Redl2010-08-091-2/+2
| | | | | | | | | | forward declarations and the definition. - Eagerly create ObjCInterfaceTypes for declarations. - The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another. - Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated. llvm-svn: 110610
* Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. ↵Argyrios Kyrtzidis2010-08-091-0/+64
| | | | | | No functionality change. llvm-svn: 110566
* Write various C++-specific records to chained PCHs. Tests will come later.Sebastian Redl2010-08-051-19/+10
| | | | llvm-svn: 110357
* Store the pending implicit instantiations in the PCH and perform them at the ↵Argyrios Kyrtzidis2010-08-051-0/+19
| | | | | | | | end of the translation unit that included the PCH, as God intended. llvm-svn: 110324
* Support #pragma weak for PCH.Argyrios Kyrtzidis2010-08-051-0/+24
| | | | llvm-svn: 110323
* Bring stats for the method pool back.Sebastian Redl2010-08-041-10/+15
| | | | llvm-svn: 110247
* Implement per-file reading of the selector table. This disables statistics ↵Sebastian Redl2010-08-041-72/+81
| | | | | | about method pool hits for the moment. llvm-svn: 110245
* When chaining, only write interesting selectors to the PCH.Sebastian Redl2010-08-041-0/+5
| | | | llvm-svn: 110229
* Store the IDs of selectors in the PCH file explicitly.Sebastian Redl2010-08-041-11/+19
| | | | llvm-svn: 110219
* Incomplete promotion of selector info to per-file data.Sebastian Redl2010-08-031-23/+21
| | | | | | Store all selectors in the selector hash table instead of only those from the method pool. llvm-svn: 110158
* Apart from storing/retrieving the previous redeclaration from PCH, also ↵Argyrios Kyrtzidis2010-08-031-2/+14
| | | | | | | | | | | | store/retrieve the most recent redeclaration. That way we are sure that the full redeclarations chain is loaded. When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH. To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need to point to a most recent redeclaration in another PCH. llvm-svn: 110125
* Avoid writing a VTABLE_USES record in PCH if there are no entries.Argyrios Kyrtzidis2010-08-031-7/+9
| | | | llvm-svn: 110122
* Query only the latest version of an identifier in the PCH chain. Make sure ↵Sebastian Redl2010-08-021-18/+5
| | | | | | this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases. llvm-svn: 110052
* Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr ↵Argyrios Kyrtzidis2010-08-021-0/+16
| | | | | | for them that will deserialize them when needed. llvm-svn: 110031
* Refactor the way PCHReader tracks whether we are in recursive loading.Argyrios Kyrtzidis2010-07-301-21/+15
| | | | | | | | | | -Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing) -Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing to ExternalASTSource. These are preparation for the next commit. llvm-svn: 109856
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-301-6/+23
| | | | | | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now. llvm-svn: 109823
* Support extended vector types in chained PCH.Sebastian Redl2010-07-281-5/+6
| | | | llvm-svn: 109675
* Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl2010-07-271-1/+2
| | | | | | PCHs; tests for this to follow. llvm-svn: 109554
* Update the list of lexical decls in the TU for chained PCHs. This makes ↵Sebastian Redl2010-07-271-0/+10
| | | | | | -ast-print show the decls from the dependent PCH. llvm-svn: 109524
* Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor2010-07-271-12/+16
| | | | | | | | | | | | | | | of the usual consistency checks used to determine when a precompiled header is incompatible with the translation unit it's being loaded into. Enable this option when loading a precompiled preamble, because the preamble loader will be performing all of this checking itself. Enable the preamble-based test now that it's working. This option is also useful for debugging Clang's PCH (<rdar://problem/7532213>). llvm-svn: 109475
* - Fix recording of offsets of types in dependent PCHs.Sebastian Redl2010-07-271-22/+7
| | | | | | | - Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH. - Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on. llvm-svn: 109474
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-261-3/+4
| | | | llvm-svn: 109396
* Make declarations in the dependent PCH visible, for C at least.Sebastian Redl2010-07-231-0/+4
| | | | llvm-svn: 109292
* PCH read/write for selector reference pool.Fariborz Jahanian2010-07-231-0/+21
| | | | | | Finishes off radar 6507158. llvm-svn: 109256
* Thread bitstream cursors all the way through the AST reading stuff. This ↵Sebastian Redl2010-07-221-23/+30
| | | | | | way, reading a trivial 2-element chained file actually works. llvm-svn: 109191
* Allow loading declcontext information from any file in the chain. Properly ↵Sebastian Redl2010-07-221-61/+81
| | | | | | write source locations to dependent files. WIP llvm-svn: 109119
* Allow loading macros from any file in the chain. WIPSebastian Redl2010-07-211-70/+89
| | | | llvm-svn: 109048
* Promote some macro-related stuff to per-file data. Fix a cache-inefficient ↵Sebastian Redl2010-07-211-40/+44
| | | | | | nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets. llvm-svn: 109030
* Allow loading identifiers from any file in the chain. WIPSebastian Redl2010-07-211-6/+17
| | | | llvm-svn: 108974
* Apparently not every system thinks that references in pairs are as cool as I ↵Sebastian Redl2010-07-201-2/+2
| | | | | | think. llvm-svn: 108959
* Allow loading declarations from any file in the chain. WIPSebastian Redl2010-07-201-2/+2
| | | | llvm-svn: 108956
* Allow loading types from any file in the chain. WIPSebastian Redl2010-07-201-9/+24
| | | | llvm-svn: 108954
* Allow loading source locations from any file in the chain. WIPSebastian Redl2010-07-201-2/+21
| | | | llvm-svn: 108942
* More work on getting PCHReader to handle multiple files. Promote SLocOffsets ↵Sebastian Redl2010-07-201-53/+71
| | | | | | to per-file data. WIP llvm-svn: 108930
* Promote IdentifierOffsets to per-file data.Sebastian Redl2010-07-191-12/+12
| | | | llvm-svn: 108762
* Promote DeclOffsets and TypeOffsets to per-file data.Sebastian Redl2010-07-191-10/+21
| | | | llvm-svn: 108760
* Promote the identifier table to per-file data. Also, if a CHAINED_METADATA ↵Sebastian Redl2010-07-191-21/+30
| | | | | | record exists, it has to be the first thing in the PCH file. llvm-svn: 108748
* Teach the PCH reader to load the dependency when encountering a chain ↵Sebastian Redl2010-07-171-77/+86
| | | | | | metadata record. WIP llvm-svn: 108578
* Separate out the initial loading of a PCH so that loading chained PCHs can ↵Sebastian Redl2010-07-161-32/+51
| | | | | | reuse it. llvm-svn: 108551
* First baby steps towards PCHReader being able to keep track of multiple PCH ↵Sebastian Redl2010-07-161-19/+47
| | | | | | files. WIP llvm-svn: 108537
* Add a little more data to chained PCHs. WIPSebastian Redl2010-07-161-2/+3
| | | | llvm-svn: 108528
* Suppress !+Asserts warning.Daniel Dunbar2010-07-161-0/+1
| | | | llvm-svn: 108480
* Add a callback interface that allows interested parties to get notified ↵Sebastian Redl2010-07-141-8/+17
| | | | | | whenever PCHReader deserializes a type or decl (and possibly other things in the future). Have PCHWriter implement these callbacks as noops and register to receive them if we're chaining PCHs. This will allow PCHWriter to track the IDs of these things, which it needs to write the dependent files. WIP llvm-svn: 108383
OpenPOWER on IntegriCloud