aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReader.cpp
AgeCommit message (Collapse)Author
2010-08-17Reintroduce the serialization library, with fixed dependencies.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17Revert Sebastian's build-breaking patch.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17Create a new Serialization module that contains all the PCH code, and will ↵Sebastian Redl
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
2010-08-13Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also ↵Argyrios Kyrtzidis
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
2010-08-13Teach ASTUnit to hold on to the Sema object and ASTConsumer that areDouglas Gregor
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
2010-08-13Instead of modifying the ObjC AST to not modify existing declarations, teach ↵Sebastian Redl
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
2010-08-12Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11-Make TokenID of IdentifierInfo read-only, remove setTokenID().Argyrios Kyrtzidis
-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
2010-08-11Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do ↵Sebastian Redl
with the breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,Douglas Gregor
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
2010-08-09- Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for ↵Sebastian Redl
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
2010-08-09Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. ↵Argyrios Kyrtzidis
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05Write various C++-specific records to chained PCHs. Tests will come later.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05Store the pending implicit instantiations in the PCH and perform them at the ↵Argyrios Kyrtzidis
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
2010-08-05Support #pragma weak for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04Bring stats for the method pool back.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110247 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04Implement per-file reading of the selector table. This disables statistics ↵Sebastian Redl
about method pool hits for the moment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04When chaining, only write interesting selectors to the PCH.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110229 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04Store the IDs of selectors in the PCH file explicitly.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03Incomplete promotion of selector info to per-file data.Sebastian Redl
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
2010-08-03Apart from storing/retrieving the previous redeclaration from PCH, also ↵Argyrios Kyrtzidis
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
2010-08-03Avoid writing a VTABLE_USES record in PCH if there are no entries.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Query only the latest version of an identifier in the PCH chain. Make sure ↵Sebastian Redl
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
2010-08-02Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr ↵Argyrios Kyrtzidis
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
2010-07-30Refactor the way PCHReader tracks whether we are in recursive loading.Argyrios Kyrtzidis
-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
2010-07-30Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl
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
2010-07-28Support extended vector types in chained PCH.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl
PCHs; tests for this to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Update the list of lexical decls in the TU for chained PCHs. This makes ↵Sebastian Redl
-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
2010-07-27Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor
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
2010-07-27- Fix recording of offsets of types in dependent PCHs.Sebastian Redl
- 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
2010-07-26Add source location information to C++ base specifiers.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23Make declarations in the dependent PCH visible, for C at least.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23PCH read/write for selector reference pool.Fariborz Jahanian
Finishes off radar 6507158. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22Thread bitstream cursors all the way through the AST reading stuff. This ↵Sebastian Redl
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
2010-07-22Allow loading declcontext information from any file in the chain. Properly ↵Sebastian Redl
write source locations to dependent files. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21Allow loading macros from any file in the chain. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21Promote some macro-related stuff to per-file data. Fix a cache-inefficient ↵Sebastian Redl
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
2010-07-21Allow loading identifiers from any file in the chain. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Apparently not every system thinks that references in pairs are as cool as I ↵Sebastian Redl
think. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Allow loading declarations from any file in the chain. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Allow loading types from any file in the chain. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Allow loading source locations from any file in the chain. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20More work on getting PCHReader to handle multiple files. Promote SLocOffsets ↵Sebastian Redl
to per-file data. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Promote IdentifierOffsets to per-file data.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Promote DeclOffsets and TypeOffsets to per-file data.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Promote the identifier table to per-file data. Also, if a CHAINED_METADATA ↵Sebastian Redl
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
2010-07-17Teach the PCH reader to load the dependency when encountering a chain ↵Sebastian Redl
metadata record. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16Separate out the initial loading of a PCH so that loading chained PCHs can ↵Sebastian Redl
reuse it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16First baby steps towards PCHReader being able to keep track of multiple PCH ↵Sebastian Redl
files. WIP git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108537 91177308-0d34-0410-b5e6-96231b3b80d8