summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
* Use the ASTMutationListener to track added template specializations in a ↵Argyrios Kyrtzidis2010-10-285-45/+16
| | | | | | chained PCH. llvm-svn: 117533
* Make AST deserialization for class template specializations lazier, byDouglas Gregor2010-10-271-16/+31
| | | | | | | not loading the specializations of a class template until some AST consumer needs them. llvm-svn: 117498
* Lazily load the next friend in the chain of FriendDecls, to eliminateDouglas Gregor2010-10-272-2/+2
| | | | | | some excessive recursion and deserialization. llvm-svn: 117480
* Lazily load the "next" namespace in the chain of NamespaceDecls, toDouglas Gregor2010-10-271-4/+3
| | | | | | eliminate some excessive recursion and deserialization. llvm-svn: 117476
* No really, we don't have a retain/release system for statements/expressionsJohn McCall2010-10-261-3/+0
| | | | | | anymore. llvm-svn: 117357
* When de-serializing a type that is supposed to be canonical, callDouglas Gregor2010-10-261-0/+4
| | | | | | | | | | | | | getCanonicalType() to make sure that the type we got back is actually canonical. This is the case for most types, which always build a canonical type when given canonical components. However, some types that involve expressions in their canonicalization (e.g., array types with dependent sizes) don't always build canonical types from canonical components, because there is no such thing as a "canonical" expression. Therefore, we do this extra mapping to ensure that the canonical types we store are actually canonical. llvm-svn: 117344
* Improve the tracking of source locations for parentheses in constructor calls.Chandler Carruth2010-10-252-5/+9
| | | | | | | | | | | | This adds them where missing, and traces them through PCH. We fix at least one bug in the extents found by the Index library, and make a lot of refactoring tools which care about the exact formulation of a constructor call easier to write. Also some minor cleanups to more consistently follow the friend pattern instead of the setter pattern when rebuilding a serialized AST. Patch originally by Samuel Benzaquen. llvm-svn: 117254
* Keep track in chained PCH of implicit members that were added after the ↵Argyrios Kyrtzidis2010-10-243-1/+20
| | | | | | definition was completed. llvm-svn: 117240
* Start fleshing out ASTMutationListener; notify when a tag definition is ↵Argyrios Kyrtzidis2010-10-243-1/+46
| | | | | | | | | 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-243-82/+96
| | | | | | | - 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-244-16/+94
| | | | | | | | | | | | 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
* Simplify and "robust-ify" the way that CXXRecord references point to the ↵Argyrios Kyrtzidis2010-10-243-58/+35
| | | | | | | | definition data when loaded from PCH. Temporary disable 'test/PCH/chain-cxx.cpp' until a better way to fix it is in place. llvm-svn: 117234
* Minor refactoring; Pull reading/writing DefinitionData out into a function.Argyrios Kyrtzidis2010-10-242-89/+96
| | | | llvm-svn: 117233
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-221-1/+1
| | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. llvm-svn: 117147
* Reorganize predefined macros for all Windows targets.Michael J. Spencer2010-10-212-0/+3
| | | | | | | | | | 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-212-65/+65
| | | | llvm-svn: 116990
* Modify the assumptions of an assert; the updated latest redeclaration can ↵Argyrios Kyrtzidis2010-10-201-6/+6
| | | | | | | | have the same location if it's a template specialization pointing at the template. llvm-svn: 116974
* Extend the preprocessing record and libclang with support forDouglas Gregor2010-10-202-17/+84
| | | | | | | | | 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
* Fix chained PCH issue; make sure all visible decls that will be put into a ↵Argyrios Kyrtzidis2010-10-201-1/+18
| | | | | | UPDATE_VISIBLE block were recorded beforehand. llvm-svn: 116931
* Minor optimization; Try to iterator over redeclarations only when necessary.Argyrios Kyrtzidis2010-10-201-9/+8
| | | | llvm-svn: 116930
* Fix issue with chained PCH where forward references did not pick up later ↵Argyrios Kyrtzidis2010-10-201-0/+18
| | | | | | definition in the chained PCH. llvm-svn: 116887
* Putting back safe fixes 116836,116837,116838Andrew Trick2010-10-191-1/+1
| | | | llvm-svn: 116866
* Reverting 116836,116837,116838 until we resolve the getLangStandardForKind ↵Andrew Trick2010-10-191-1/+1
| | | | | | failures. llvm-svn: 116859
* Fix up the comments for creating ParmVarDeclAbbrev to reflect reality.Argyrios Kyrtzidis2010-10-191-1/+1
| | | | llvm-svn: 116838
* Read/write declaration attributes from/to PCH properly. Embed them in the ↵Argyrios Kyrtzidis2010-10-183-25/+9
| | | | | | | | | 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
* White-listing templated-scope friend decls is a good idea, but doing itJohn McCall2010-10-162-0/+2
| | | | | | | | by marking the decl invalid isn't. Make some steps towards supporting these and then hastily shut them down at the last second by marking them as unsupported. llvm-svn: 116661
* Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClassFariborz Jahanian2010-10-152-2/+0
| | | | | | AST node. (finishing off radar 8525788). llvm-svn: 116603
* Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and ↵Argyrios Kyrtzidis2010-10-156-36/+166
| | | | | | QualifierInfos (rdar://8513756). llvm-svn: 116598
* When performing typo correction, look through the set of knownDouglas Gregor2010-10-141-0/+62
| | | | | | | | | | | | | | | | | | | | identifiers to determine good typo-correction candidates. Once we've identified those candidates, we perform name lookup on each of them and the consider the results. This optimization makes typo correction > 2x faster on a benchmark example using a single typo (NSstring) in a tiny file that includes Cocoa.h from a precompiled header, since we are deserializing far less information now during typo correction. There is a semantic change here, which is interesting. The presence of a similarly-named entity that is not visible can now affect typo correction. This is both good (you won't get weird corrections if the thing you wanted isn't in scope) and bad (you won't get good corrections if there is a similarly-named-but-completely-unrelated thing). Time will tell whether it was a good choice or not. llvm-svn: 116528
* At Fariborz's request, a somewhat cleaner bit-combining hack.John McCall2010-10-141-3/+3
| | | | llvm-svn: 116524
* Store in PCH the key function of C++ class to avoid deserializing the ↵Argyrios Kyrtzidis2010-10-142-0/+14
| | | | | | | | complete declaration context in order to compute it. Progress for rdar://7260160. llvm-svn: 116508
* Allow deserialization of just the fields of a record, when we want to ↵Argyrios Kyrtzidis2010-10-142-13/+18
| | | | | | | | | | | | | 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
* Give a default implementation for ASTDeserializationListener's methods, no ↵Argyrios Kyrtzidis2010-10-141-0/+4
| | | | | | functionality change. llvm-svn: 116506
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-143-19/+19
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-082-2/+11
| | | | | | bit by me). llvm-svn: 116122
* Implement -fshort-enums (rdar://8490496).Argyrios Kyrtzidis2010-10-081-0/+1
| | | | llvm-svn: 116020
* Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.Douglas Gregor2010-10-052-0/+2
| | | | llvm-svn: 115667
* Fix a marvelous chained AST writing bug, where we end up with theDouglas Gregor2010-10-052-6/+13
| | | | | | | | | | | | | | | | | | | | | | | 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
* Give every file that ASTReader loads a type: module, PCH, precompiled ↵Sebastian Redl2010-10-052-9/+11
| | | | | | preamble or main file. Base Decls' PCHLevel on this to make it more sane. llvm-svn: 115626
* Thread PerFileData through the ASTReader again, this time with the LLVM changes.Sebastian Redl2010-10-053-474/+508
| | | | llvm-svn: 115625
* 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-022-17/+42
| | | | | | the "detailed" preprocessing record. llvm-svn: 115417
* Revert r115336 ("Thread PerFileData through everything."), becauseDouglas Gregor2010-10-013-508/+475
| | | | | | we're missing the corresponding changes in the LLVM repository. llvm-svn: 115340
* Thread PerFileData through everything. This allows us to remap stuff later.Sebastian Redl2010-10-013-475/+508
| | | | llvm-svn: 115336
* Record module loaders and module source order.Sebastian Redl2010-10-011-1/+7
| | | | llvm-svn: 115334
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-012-0/+2
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* If we get a TU_CONTEXT update from a chained PCH file before weDouglas Gregor2010-10-011-2/+14
| | | | | | | actually have an ASTContext, delay the processing of that update. Patch by Sebastian Redl! Fixes <rdar://problem/8499034>. llvm-svn: 115263
* 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
OpenPOWER on IntegriCloud