aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.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-17Patch to add type parameter support for attribute iboutletcollection.Fariborz Jahanian
Radar 8308053. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111275 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-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-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-05Implement #pragma GCC visibility.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04Activate selectors in chained PCH. Chained PCH now works for Objective-C.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110262 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-02Simplify global method pool implementation in Sema. No functionality change.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110078 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-30Safely get a data pointer for vectors that might be empty.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109867 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-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-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-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-16Add a little more data to chained PCHs. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Add a callback interface that allows interested parties to get notified ↵Sebastian Redl
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12Fix a documentation paste-o and eliminate a useless function parameter, both ↵Douglas Gregor
found by Sebastian git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12Split the normal and chained PCH writing paths and add a tiny bit of ↵Sebastian Redl
implementation to the latter. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09When given the -chained-pch option and a previous PCH file, have the ↵Sebastian Redl
PCHWriter emit a CHAINED_METADATA record instead of METADATA, and write a link to the previous file there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09Introduce -f{no-}spell-checking options to enable/disableDouglas Gregor
spell-checking. By default, spell-checking is enabled for Clang (obviously) but disabled in CIndex for performance reasons. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08Some preparatory work for chained PCH. No functionality change.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08For TagType and TemplateSpecializationType, isDependent calculation may be ↵Argyrios Kyrtzidis
invalid because some decls that the calculation is using may still be initializing. Thus, store the isDependent flag to PCH and restore directly to Type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06Add to PCH missing Sema information about VTable uses and dynamic classes.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04Don't try to install the __[u]int128_t identifier if it is already installed ↵Argyrios Kyrtzidis
by PCHReader. Currently, adding it to visible decls of a PCH'ed translation unit has no effect because adding visible decls before deserialization has no effect (the decls won't be visible). This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Read/write CastExpr's CXXBaseSpecifierArray for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107542 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fully read/write CXXRecordDecl for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fix reading of DependentNameType.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02- Allow a typedef type to be read from PCH even if its decl is currently ↵Argyrios Kyrtzidis
initializing. - Fix creation of TemplateSpecializationType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-30Support DependentSizedArrayType for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107267 91177308-0d34-0410-b5e6-96231b3b80d8