summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* rework the stat cache, pulling it out of FileManager.h intoChris Lattner2010-11-231-0/+1
| | | | | | | its own header and giving it some more structure. No functionality change. llvm-svn: 120030
* Add a variant of GCC-style vector types for ARM NEON.Bob Wilson2010-11-101-1/+1
| | | | | | | | | NEON vector types need to be mangled in a special way to comply with ARM's ABI, similar to some of the AltiVec-specific vector types. This patch is mostly just renaming a bunch of "AltiVecSpecific" things, since they will no longer be specific to AltiVec. Besides that, it just adds the new "NeonVector" enum. llvm-svn: 118724
* Remove broken support for variadic templates, along with the variousDouglas Gregor2010-11-071-2/+2
| | | | | | | | | | | | | abstractions (e.g., TemplateArgumentListBuilder) that were designed to support variadic templates. Only a few remnants of variadic templates remain, in the parser (parsing template type parameter packs), AST (template type parameter pack bits and TemplateArgument::Pack), and Sema; these are expected to be used in a future implementation of variadic templates. But don't get too excited about that happening now. llvm-svn: 118385
* Don't write an empty DIAG_USER_MAPPINGS record.Argyrios Kyrtzidis2010-11-051-1/+2
| | | | llvm-svn: 118305
* Read/write from/to PCH the diagnostic mappings that the user set so that ↵Argyrios Kyrtzidis2010-11-051-0/+17
| | | | | | | | e.g. #pragma clang diagnostic can be used in a PCH. Fixes rdar://8435969. llvm-svn: 118303
* Flush statements after writing each DECL_CXX_BASE_SPECIFIERS nodeDouglas Gregor2010-10-301-0/+3
| | | | llvm-svn: 117770
* Make the deserialization of C++ base class specifiers lazy, improvingDouglas Gregor2010-10-291-7/+70
| | | | | | the performance of C++ PCH and reducing stack depth in the reader. llvm-svn: 117732
* Use the ASTMutationListener to track when a named decl gets added to a ↵Argyrios Kyrtzidis2010-10-281-17/+22
| | | | | | | | DeclContext, meaning we need to rewrite its name lookup table in a chained PCH. llvm-svn: 117536
* Properly add chained template specializations.Argyrios Kyrtzidis2010-10-281-0/+2
| | | | llvm-svn: 117535
* Fix the re-serializing decls in a chained PCH mechanism.Argyrios Kyrtzidis2010-10-281-5/+4
| | | | llvm-svn: 117534
* Use the ASTMutationListener to track added template specializations in a ↵Argyrios Kyrtzidis2010-10-281-19/+10
| | | | | | chained PCH. llvm-svn: 117533
* Keep track in chained PCH of implicit members that were added after the ↵Argyrios Kyrtzidis2010-10-241-0/+14
| | | | | | definition was completed. llvm-svn: 117240
* Start fleshing out ASTMutationListener; notify when a tag definition is ↵Argyrios Kyrtzidis2010-10-241-0/+29
| | | | | | | | | completed. In that case a chained PCH will record the updates to the DefinitionData pointer of forward references. If a forward reference mutated into a definition re-write it into the chained PCH, this is too big of a change. llvm-svn: 117239
* Introduce a DeclsToRewrite field in ASTWrite, used for collecting the decls ↵Argyrios Kyrtzidis2010-10-241-0/+7
| | | | | | that will be replaced in the chained PCH. llvm-svn: 117238
* Some method renaming, no functionality change.Argyrios Kyrtzidis2010-10-241-4/+4
| | | | llvm-svn: 117237
* Refactoring.Argyrios Kyrtzidis2010-10-241-33/+71
| | | | | | | - Pass around RecordDataImpl instead of the concrete RecordData so that any SmallVector can be used. - Move ASTDeclWriter::WriteCXXDefinitionData to ASTWriter::AddCXXDefinitionData. llvm-svn: 117236
* Put the mechanism in place to track modifications in an AST entity that were ↵Argyrios Kyrtzidis2010-10-241-13/+37
| | | | | | | | | | | | committed after its initial creation/deserialization and store the changes in a chained PCH. The idea is that the AST entities call methods on the ASTMutationListener to give notifications of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes of the updated entity. WIP llvm-svn: 117235
* Reorganize predefined macros for all Windows targets.Michael J. Spencer2010-10-211-0/+2
| | | | | | | | | | This adds an option to set the _MSC_VER macro without recompiling. This is very useful when testing compatibility with the Windows SDK and c++stdlib headers. -fmsc-version=<version> (defaults to VS2003 (1300)) llvm-svn: 116999
* Fix Whitespace.Michael J. Spencer2010-10-211-25/+25
| | | | llvm-svn: 116990
* Extend the preprocessing record and libclang with support forDouglas Gregor2010-10-201-1/+32
| | | | | | | | | inclusion directives, keeping track of every #include, #import, etc. in the translation unit. We keep track of the source location and kind of the inclusion, how the file name was spelled, and the underlying file to which the inclusion resolved. llvm-svn: 116952
* Read/write declaration attributes from/to PCH properly. Embed them in the ↵Argyrios Kyrtzidis2010-10-181-5/+2
| | | | | | | | | declaration block instead of trying to create another block. The new block was messing with the assumption that after decls block comes the stmts block. Fixes http://llvm.org/PR8406 llvm-svn: 116737
* Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and ↵Argyrios Kyrtzidis2010-10-151-0/+49
| | | | | | QualifierInfos (rdar://8513756). llvm-svn: 116598
* Allow deserialization of just the fields of a record, when we want to ↵Argyrios Kyrtzidis2010-10-141-6/+7
| | | | | | | | | | | | | iterate over them, instead of deserializing the complete declaration context of the record. Iterating over the fields of a record is very common (e.g to determine the layout), unfortunately we needlessly deserialize every declaration that the declaration context of the record contains; this can be bad for large C++ classes that contain a lot of methods. Fix this by allow deserialization of just the fields when we want to iterate over them. Progress for rdar://7260160. llvm-svn: 116507
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-1/+0
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Fix a marvelous chained AST writing bug, where we end up with theDouglas Gregor2010-10-051-6/+10
| | | | | | | | | | | | | | | | | | | | | | | following amusing sequence: - AST writing schedules writing a type X* that it had never seen before - AST writing starts writing another declaration, ends up deserializing X* from a prior AST file. Now we have two type IDs for the same type! - AST writer tries to write X*. It only has the lower-numbered ID from the the prior AST file, so references to the higher-numbered ID that was scheduled for writing go off into lalaland. To fix this, keep the higher-numbered ID so we end up writing the type twice. Since this issue occurs so rarely, and type records are generally rather small, I deemed this better than the alternative: to keep a separate mapping from the higher-numbered IDs to the lower-numbered IDs, which we would end up having to check whenever we want to deserialize any type. Fixes <rdar://problem/8511624>, I think. llvm-svn: 115647
* When a type comes from a previously-loaded PCH/AST file, don't try to write ↵Douglas Gregor2010-10-041-0/+5
| | | | | | it into a chained PCH file. llvm-svn: 115527
* Implement chained PCH support for the macro definitions stored withinDouglas Gregor2010-10-021-6/+21
| | | | | | the "detailed" preprocessing record. llvm-svn: 115417
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-011-0/+1
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* When an identifier that has a macro definition in the original PCHDouglas Gregor2010-10-011-1/+7
| | | | | | | file is somehow changed in a chained PCH file, make sure that we write out the macro definition. Fixes part of <rdar://problem/8499034>. llvm-svn: 115259
* My previous fix was incorrect for non-chained PCH reuse. Fix again.Sebastian Redl2010-09-271-1/+1
| | | | llvm-svn: 114922
* When chaining PCHs, only write PPRecords that don't come from PCH, and give ↵Sebastian Redl2010-09-271-3/+5
| | | | | | them the correct IDs. Fixes a crash in XCode. llvm-svn: 114913
* Change source manager serialization to be less tied to the PCH model.Sebastian Redl2010-09-221-1/+2
| | | | llvm-svn: 114575
* Macro definitions in AST files have their own IDs.Sebastian Redl2010-09-151-4/+4
| | | | llvm-svn: 114014
* Replace loops with SmallVector::append.Benjamin Kramer2010-09-061-4/+2
| | | | llvm-svn: 113185
* Avoid implicit string construction.Benjamin Kramer2010-09-021-1/+1
| | | | llvm-svn: 112820
* Rename *PendingImplicitInstantiations to *PendingInstantiations. NoChandler Carruth2010-08-251-16/+14
| | | | | | functionality changed. llvm-svn: 112040
* Move more stuff out of Sema.h.John McCall2010-08-251-0/+1
| | | | llvm-svn: 112026
* AST writer support for having specializations of templates from earlier in ↵Sebastian Redl2010-08-241-0/+19
| | | | | | the chain. This ought to finish C++ chained PCH support. llvm-svn: 111986
* Remove a header dependency from Sema.h at the cost of some type safety.John McCall2010-08-241-0/+1
| | | | | | If someone wants to fix this some other way.... llvm-svn: 111905
* Add testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.Sebastian Redl2010-08-241-13/+3
| | | | llvm-svn: 111882
* Write visible update blocks. No regressions in normal PCH functionality, but ↵Sebastian Redl2010-08-241-1/+76
| | | | | | no tests for the chain yet. llvm-svn: 111881
* Fix an issue with writing to PCH another included PCH, introduced by the ↵Argyrios Kyrtzidis2010-08-201-1/+4
| | | | | | | | | | | "using an AST on-disk hash table for name lookup" commit. When including a PCH and later re-emitting to another PCH, the name lookup tables of DeclContexts may be incomplete, since we now lazily deserialize the visible decls of a particular name. Fix the issue by iterating over the un-deserialized visible decls and completing the lookup tables of DeclContexts before writing them out. llvm-svn: 111698
* Use the AST on-disk hash table for name lookup inside a DeclContext.Argyrios Kyrtzidis2010-08-201-53/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *Huge* improvement over the amount of deserializing that we do for C++ lookup. e.g, if he have the Carbon header precompiled and include it on a file containing this: int x; these are the before/after stats: BEFORE: *** AST File Statistics: 578 stat cache hits 4 stat cache misses 548/30654 source location entries read (1.787695%) 15907/16501 types read (96.400223%) 53525/59955 declarations read (89.275291%) 33993/43525 identifiers read (78.099945%) 41516/51891 statements read (80.006165%) 77/5317 macros read (1.448185%) 0/6335 lexical declcontexts read (0.000000%) 1/5424 visible declcontexts read (0.018437%) AFTER using the on-disk table: *** AST File Statistics: 578 stat cache hits 4 stat cache misses 548/30654 source location entries read (1.787695%) 10/16501 types read (0.060602%) 9/59955 declarations read (0.015011%) 161/43525 identifiers read (0.369902%) 20/51891 statements read (0.038542%) 6/5317 macros read (0.112846%) 0/6335 lexical declcontexts read (0.000000%) 2/5424 visible declcontexts read (0.036873%) There's only one issue affecting mostly the precompiled preambles which I will address soon. llvm-svn: 111636
* Introduce the mechanism for building an AST on-disk hash table for name ↵Argyrios Kyrtzidis2010-08-201-6/+130
| | | | | | lookup inside a DeclContext but don't use it yet. llvm-svn: 111635
* Refactoring; move the functionality of ASTWriter::GetOrCreateTypeID to the ↵Argyrios Kyrtzidis2010-08-201-50/+6
| | | | | | | | | | more generic MakeTypeID template function which accepts a type and a function object that returns a TypeIdx. MakeTypeID is in PCHCommon.h so that it can be used by ASTReader too. llvm-svn: 111634
* Introduce ASTWriter::GetOrCreateTypeID and move most of the functionality of ↵Argyrios Kyrtzidis2010-08-201-17/+10
| | | | | | | | AddTypeRef there. No functionality change. llvm-svn: 111633
* A bit of refactoring; Introduce ASTWriter::GetOrCreateTypeIdx and move the ↵Argyrios Kyrtzidis2010-08-201-10/+21
| | | | | | | | emission of types there. No functionality change. llvm-svn: 111632
* Rename TypeIDs -> TypeIdxs. No functionality change.Argyrios Kyrtzidis2010-08-201-4/+4
| | | | llvm-svn: 111631
* serialization::TypeID is used with or without qualifiers, both as index and ↵Argyrios Kyrtzidis2010-08-201-15/+15
| | | | | | | | as index + qualifiers. Disambiguate and provide some type safety by using a new class TypeIdx for the "TypeID as index" semantics. llvm-svn: 111630
* Share the common code of ComputeHash(Selector Sel) instead of keeping 2 ↵Argyrios Kyrtzidis2010-08-201-8/+2
| | | | | | | | copies in PCHReader and PCHWriter. No functionality change. llvm-svn: 111629
OpenPOWER on IntegriCloud