aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriterDecl.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-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-11Added locations and type source info for DeclarationName.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 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-09Complete PCH support for ObjCPropertyImplDecl.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09Support ObjC implementation decls for PCH.Argyrios Kyrtzidis
Strictly speaking, implementations don't go in headers but there's no law against it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110567 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-06Remove the DeclaredInCondition bit now that it's no longer used.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05Collect namespaces that need updating in a PCH chain. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110378 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-07-29Change the name to something less terrible; suggestion by Doug. No ↵Argyrios Kyrtzidis
functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis
CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext, thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen. This fixes current (and avoids future) codegen-from-PCH bugs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Store latest redeclaration for each redeclarable template declarationPeter Collingbourne
This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase class which is used to store the latest redeclaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29Refactor redeclarable template declarationsPeter Collingbourne
This patch refactors much of the common code in ClassTemplateDecl and FunctionTemplateDecl into a common base class RedeclarableTemplateDecl together with support functions in a template class RedeclarableTemplate. The patch also includes similar refactoring for these classes' PCH reader and writer implementations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Revert r109546, it broke linux build.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis
CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. This fixes current (and avoids future) codegen-from-PCH bugs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Always deserialize from PCH file scoped variables with non trivial ↵Argyrios Kyrtzidis
constructor/destructor. Fixes http://llvm.org/PR7692 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109501 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-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-22atch for implementation of objective-c's -WselectorFariborz Jahanian
warning flag in clang. Little more to do for a PCH issue. Radar 6507158. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22Read/write C++0x static_assert for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109123 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22Read/write FriendTemplateDecl for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Hide FunctionTemplateDecl's specializations folding set as implementation ↵Argyrios Kyrtzidis
detail and introduce FunctionTemplateDecl::findSpecialization. Redeclarations of specializations will not cause the previous decl to be removed from the set, the set will keep the canonical decl. findSpecialization will return the most recent redeclaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Whether the specialization should be added to template's folding set when ↵Argyrios Kyrtzidis
read from PCH, is determined by a isCanonicalDecl check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17Added PCH/ASTImporter code for ObjCIvarDecl's field.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09Reorganize how ClassTemplate[Partial]SpecializationDecls are read/written to ↵Argyrios Kyrtzidis
avoid the possibility of adding an unitialized one into the folding set. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08Support TemplateTemplateParmDecl for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06Read/write function template specializations for PCH, properly this time.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06Allow a CXXRecordDecl to get a DefinitionData pointer even when its owner is ↵Argyrios Kyrtzidis
still initializing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06Read/write instantiated-from-member of EnumDecl for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-05Read/write the identifier namespace in PCH for decls that may modify it.Argyrios Kyrtzidis
We can now use a PCH'ed <map>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-05Read/write some source location for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04Read/write more information of ASTContext for PCH. Overriden methods and ↵Argyrios Kyrtzidis
instantiated-from information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04Write/read ParmVarDecl's UninstantiatedDefaultArg for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04Read/write specialization info of static data members for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-03Lazily declare default constructors. We now delay the construction ofDouglas Gregor
declarations for implicit default constructors, copy constructors, copy assignment operators, and destructors. On a "simple" translation unit that includes a bunch of C++ standard library headers, we generate relatively few of these implicit declarations now: 4/159 implicit default constructors created 18/236 implicit copy constructors created 70/241 implicit copy assignment operators created 0/173 implicit destructors created And, on this translation unit, this optimization doesn't really provide any benefit. I'll do some more performance measurements soon, but this completes the implementation work for <rdar://problem/8151045>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Lazily declare implicit copy constructors.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107543 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-02Lazily declare copy-assignment operators.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Lazily declare the implicitly-declared destructor in a C++ class.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Handle CXXConstructorDecl, CXXDestructorDecl, and CXXConversionDecl for PCH.Argyrios Kyrtzidis
<vector> header can be used correctly through PCH now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fix reading FunctionDecls from PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fix reading ClassTemplateDecl's ClassTemplateSpecializationDecls and ↵Argyrios Kyrtzidis
ClassTemplatePartialSpecializationDecls. Store/read also their template arguments because they may be initializing and not be able to provide them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107476 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-02Generally types expect an initialized TypeDecl; its safer and less ↵Argyrios Kyrtzidis
complicated to delay PCH reading the type of a TypeDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-30Fix PCH support for UnresolvedUsingTypenameDecl and UnresolvedUsingValueDecl.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29Support C++ friend declarations for PCH.Argyrios Kyrtzidis
This commit 'introduces' a slightly different way to restore the state of the AST object. It makes PCHDeclReader/PCHDeclWriter friends and gives them access to the private members of the object. The rationale is to avoid using/modifying the AST interfaces for PCH read/write so that to: -Avoid complications with objects that have side-effects during creation or when using some setters. -Not 'pollute' the AST interface with methods only used by the PCH reader/writer -Allow AST objects to be read-only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107219 91177308-0d34-0410-b5e6-96231b3b80d8