summaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReader.cpp
Commit message (Collapse)AuthorAge
* Reintroduce the serialization library, with fixed dependencies.Sebastian Redl2010-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111279 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert Sebastian's build-breaking patch.Douglas Gregor2010-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111265 91177308-0d34-0410-b5e6-96231b3b80d8
* Create a new Serialization module that contains all the PCH code, and will ↵Sebastian Redl2010-08-17
| | | | | | contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111258 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also ↵Argyrios Kyrtzidis2010-08-13
| | | | | | | | keeping track of unused file scoped variables. This is only preparation, currently only static function definitions are tracked, as before. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111025 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ASTUnit to hold on to the Sema object and ASTConsumer that areDouglas Gregor2010-08-13
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111003 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of modifying the ObjC AST to not modify existing declarations, teach ↵Sebastian Redl2010-08-13
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110989 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
* -Make TokenID of IdentifierInfo read-only, remove setTokenID().Argyrios Kyrtzidis2010-08-11
| | | | | | | | -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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110868 91177308-0d34-0410-b5e6-96231b3b80d8
* Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do ↵Sebastian Redl2010-08-11
| | | | | | with the breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110840 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,Douglas Gregor2010-08-11
| | | | | | | | | and create separate decl nodes for forward declarations and the definition," which appears to be causing significant Objective-C breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110803 91177308-0d34-0410-b5e6-96231b3b80d8
* - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for ↵Sebastian Redl2010-08-09
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110610 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. ↵Argyrios Kyrtzidis2010-08-09
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110566 91177308-0d34-0410-b5e6-96231b3b80d8
* Write various C++-specific records to chained PCHs. Tests will come later.Sebastian Redl2010-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110357 91177308-0d34-0410-b5e6-96231b3b80d8
* Store the pending implicit instantiations in the PCH and perform them at the ↵Argyrios Kyrtzidis2010-08-05
| | | | | | | | end of the translation unit that included the PCH, as God intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110324 91177308-0d34-0410-b5e6-96231b3b80d8
* Support #pragma weak for PCH.Argyrios Kyrtzidis2010-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110323 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring stats for the method pool back.Sebastian Redl2010-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110247 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement per-file reading of the selector table. This disables statistics ↵Sebastian Redl2010-08-04
| | | | | | about method pool hits for the moment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110245 91177308-0d34-0410-b5e6-96231b3b80d8
* When chaining, only write interesting selectors to the PCH.Sebastian Redl2010-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110229 91177308-0d34-0410-b5e6-96231b3b80d8
* Store the IDs of selectors in the PCH file explicitly.Sebastian Redl2010-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110219 91177308-0d34-0410-b5e6-96231b3b80d8
* Incomplete promotion of selector info to per-file data.Sebastian Redl2010-08-03
| | | | | | Store all selectors in the selector hash table instead of only those from the method pool. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110158 91177308-0d34-0410-b5e6-96231b3b80d8
* Apart from storing/retrieving the previous redeclaration from PCH, also ↵Argyrios Kyrtzidis2010-08-03
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110125 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid writing a VTABLE_USES record in PCH if there are no entries.Argyrios Kyrtzidis2010-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110122 91177308-0d34-0410-b5e6-96231b3b80d8
* Query only the latest version of an identifier in the PCH chain. Make sure ↵Sebastian Redl2010-08-02
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110052 91177308-0d34-0410-b5e6-96231b3b80d8
* Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr ↵Argyrios Kyrtzidis2010-08-02
| | | | | | for them that will deserialize them when needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor the way PCHReader tracks whether we are in recursive loading.Argyrios Kyrtzidis2010-07-30
| | | | | | | | | | -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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109856 91177308-0d34-0410-b5e6-96231b3b80d8
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-30
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109823 91177308-0d34-0410-b5e6-96231b3b80d8
* Support extended vector types in chained PCH.Sebastian Redl2010-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109675 91177308-0d34-0410-b5e6-96231b3b80d8
* Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl2010-07-27
| | | | | | PCHs; tests for this to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109554 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the list of lexical decls in the TU for chained PCHs. This makes ↵Sebastian Redl2010-07-27
| | | | | | -ast-print show the decls from the dependent PCH. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109524 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor2010-07-27
| | | | | | | | | | | | | | | | | 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>). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109475 91177308-0d34-0410-b5e6-96231b3b80d8
* - Fix recording of offsets of types in dependent PCHs.Sebastian Redl2010-07-27
| | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109474 91177308-0d34-0410-b5e6-96231b3b80d8
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109396 91177308-0d34-0410-b5e6-96231b3b80d8
* Make declarations in the dependent PCH visible, for C at least.Sebastian Redl2010-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109292 91177308-0d34-0410-b5e6-96231b3b80d8
* PCH read/write for selector reference pool.Fariborz Jahanian2010-07-23
| | | | | | | | Finishes off radar 6507158. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109256 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread bitstream cursors all the way through the AST reading stuff. This ↵Sebastian Redl2010-07-22
| | | | | | way, reading a trivial 2-element chained file actually works. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109191 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow loading declcontext information from any file in the chain. Properly ↵Sebastian Redl2010-07-22
| | | | | | write source locations to dependent files. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109119 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow loading macros from any file in the chain. WIPSebastian Redl2010-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109048 91177308-0d34-0410-b5e6-96231b3b80d8
* Promote some macro-related stuff to per-file data. Fix a cache-inefficient ↵Sebastian Redl2010-07-21
| | | | | | nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109030 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow loading identifiers from any file in the chain. WIPSebastian Redl2010-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108974 91177308-0d34-0410-b5e6-96231b3b80d8
* Apparently not every system thinks that references in pairs are as cool as I ↵Sebastian Redl2010-07-20
| | | | | | think. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108959 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow loading declarations from any file in the chain. WIPSebastian Redl2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108956 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow loading types from any file in the chain. WIPSebastian Redl2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108954 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow loading source locations from any file in the chain. WIPSebastian Redl2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108942 91177308-0d34-0410-b5e6-96231b3b80d8
* More work on getting PCHReader to handle multiple files. Promote SLocOffsets ↵Sebastian Redl2010-07-20
| | | | | | to per-file data. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108930 91177308-0d34-0410-b5e6-96231b3b80d8
* Promote IdentifierOffsets to per-file data.Sebastian Redl2010-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108762 91177308-0d34-0410-b5e6-96231b3b80d8
* Promote DeclOffsets and TypeOffsets to per-file data.Sebastian Redl2010-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108760 91177308-0d34-0410-b5e6-96231b3b80d8
* Promote the identifier table to per-file data. Also, if a CHAINED_METADATA ↵Sebastian Redl2010-07-19
| | | | | | record exists, it has to be the first thing in the PCH file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108748 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the PCH reader to load the dependency when encountering a chain ↵Sebastian Redl2010-07-17
| | | | | | metadata record. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108578 91177308-0d34-0410-b5e6-96231b3b80d8
* Separate out the initial loading of a PCH so that loading chained PCHs can ↵Sebastian Redl2010-07-16
| | | | | | reuse it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108551 91177308-0d34-0410-b5e6-96231b3b80d8
* First baby steps towards PCHReader being able to keep track of multiple PCH ↵Sebastian Redl2010-07-16
| | | | | | files. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108537 91177308-0d34-0410-b5e6-96231b3b80d8