summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [AST] Put VarDeclBitfields on a dietDavid Majnemer2015-05-191-14/+9
| | | | | | | | VarDeclBitfields contained bits which are never present in parameters. Split these out so that ParmVarDeclBitfields wouldn't grow past 32-bits if another field was added. llvm-svn: 237648
* [Modules] Work around PR23030 again, in a different code path, whereChandler Carruth2015-03-271-6/+9
| | | | | | | | | | I again added the "reasonable" assertions and they again fired during a modules self-host. This hopefully will un-break the self-host build bot. No test case handy and adding one seems to have little or no value really. llvm-svn: 233426
* [Modules] When walking the lookup results in a namespace, sort them byChandler Carruth2015-03-271-9/+23
| | | | | | | | | | | | declaration name so that we mark declarations for emission in a deterministic order (and in turn give them deterministic IDs). This is the last for loop or data structure I can find by inspection of the AST writer which doesn't use a deterministic order. Found by inspection, no test case. llvm-svn: 233348
* [Modules] Delete a bunch of complex code for ensuring visible decls inChandler Carruth2015-03-261-2/+2
| | | | | | | | | | | | | | updated decl contexts get emitted. Since this code was added, we have newer vastly simpler code for handling this. The code I'm removing was very expensive and also generated unstable order of declarations which made module outputs non-deterministic. All of the tests continue to pass for me and I'm able to check the difference between the .pcm files after merging modules together. llvm-svn: 233251
* [modules] Deserialize CXXCtorInitializer list for a constructor lazily.Richard Smith2015-03-241-14/+15
| | | | | | | | | | | | | Previously we'd deserialize the list of mem-initializers for a constructor when we deserialized the declaration of the constructor. That could trigger a significant amount of unnecessary work (pulling in all base classes recursively, for a start) and was causing problems for the modules buildbot due to cyclic deserializations. We now deserialize these on demand. This creates a certain amount of duplication with the handling of CXXBaseSpecifiers; I'll look into reducing that next. llvm-svn: 233052
* [modules] Don't clobber a destructor's operator delete when adding another one;Richard Smith2015-03-101-1/+1
| | | | | | | move the operator delete updating into a separate update record so we can cope with updating another module's destructor's operator delete. llvm-svn: 231735
* [modules] Rework merging of redeclaration chains on module import.Richard Smith2015-03-051-14/+31
| | | | | | | | | | | | | | | | | | | | | | We used to save out and eagerly load a (potentially huge) table of merged formerly-canonical declarations when we loaded each module. This was extremely inefficient in the presence of large amounts of merging, and didn't actually save any merging lookup work, because we still needed to perform name lookup to check that our merged declaration lists were complete. This also resulted in a loss of laziness -- even if we only needed an early declaration of an entity, we would eagerly pull in all declarations that had been merged into it regardless. We now store the relevant fragments of the table within the declarations themselves. In detail: * The first declaration of each entity within a module stores a list of first declarations from imported modules that are merged into it. * Loading that declaration pre-loads those other entities, so that they appear earlier within the redeclaration chain. * The name lookup tables list the most recent local lookup result, if there is one, or all directly-imported lookup results if not. llvm-svn: 231424
* [modules] When writing out a list of specializations for a template, if we haveRichard Smith2015-02-271-51/+58
| | | | | | | | undeserialized specializations (because we merged an imported declaration of the same template since we last added one), don't bother reading in the specializations themselves just so we can write out their IDs again. llvm-svn: 230805
* [modules] Treat friend declarations that are lexically within a dependentRichard Smith2015-02-071-2/+11
| | | | | | | context as anonymous for merging purposes. They can't be found by their names, so we merge them based on their position within the surrounding context. llvm-svn: 228485
* PR22405: don't lose implicit-deleted-ness across AST write / read.Richard Smith2015-02-061-14/+14
| | | | llvm-svn: 228464
* [modules] If a module declares an entity and then imports another declarationRichard Smith2015-02-061-8/+26
| | | | | | | | | of that entity, ensure that the redeclaration chain is reordered properly on reload. Otherwise, the result of name lookup for that entity may point to an entity that is too old; if that's an injected friend name or the like, that can result in the name not being found at all. llvm-svn: 228371
* Rename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFCAlexey Bataev2015-01-121-2/+2
| | | | llvm-svn: 225624
* Renamed RefersToEnclosingLocal bitfield to RefersToCapturedVariable.Alexey Bataev2014-12-161-1/+2
| | | | | | | Bitfield RefersToEnclosingLocal of Stmt::DeclRefExprBitfields renamed to RefersToCapturedVariable to reflect latest changes introduced in commit 224323. Also renamed method Expr::refersToEnclosingLocal() to Expr::refersToCapturedVariable() and comments for constant arguments. No functional changes. llvm-svn: 224329
* Change how we distinguish bitfield widths, in-classJohn McCall2014-10-101-9/+8
| | | | | | | | initializers, and captured VLA types so that we can answer questions like "is this a bit-field" without looking at the enclosing DeclContext. NFC. llvm-svn: 219522
* [modules] Make NamespaceAliasDecl redeclarable, as it should be. This fixesRichard Smith2014-09-031-0/+1
| | | | | | | merging of namespace aliases across modules and improves source fidelity. Incidentally also fixes PR20816. llvm-svn: 217103
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-301-2/+2
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216824
* [modules] Fix deserialization cycle when loading a tag declaration with a ↵Richard Smith2014-08-301-10/+19
| | | | | | typedef name for linkage purposes. When loading the type, delay loading its typedef until we've finished loading and merging the type. In its place, save out the name of the typedef, which we need for merging purposes. llvm-svn: 216806
* [C++11] Support for capturing of variable length arrays in lambda expression.Alexey Bataev2014-08-281-3/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
* [modules] Number anonymous declarations that are lexically within mergeableRichard Smith2014-08-281-0/+6
| | | | | | contexts, so that we can merge them when we merge the surrounding context. llvm-svn: 216639
* [modules] Add an assert that we properly manage the IsCompleteDefinition flagRichard Smith2014-08-271-1/+2
| | | | | | | | on CXXRecordDecls when merging definitions, and make it pass by not trying to save and restore this flag across AST serialization/deserialization. For CXXRecordDecls, we have a separate mechanism to manage this. llvm-svn: 216633
* [modules] Track the described template in an alias declaration that is theRichard Smith2014-08-261-0/+1
| | | | | | | pattern of an alias template declaration. Use this to merge alias templates properly when they're members of class template specializations. llvm-svn: 216437
* [modules] Add abbreviation for ImplicitCastExpr. This is the most commonRichard Smith2014-07-271-0/+18
| | | | | | record type in LLVM's IR module. llvm-svn: 214048
* [modules] Improve abbreviations for C++:Richard Smith2014-07-261-8/+72
| | | | | | | | | | | | | | | | | * Add abbreviation for CXXMethodDecl and for FunctionProtoType. These come up a *lot* in C++ modules. * Allow typedef declarations to use the abbreviation if they're class members, or if they're used. In passing, add more record name records for Clang AST node kinds. The downside is that we had already used up our allotment of 12 abbreviations, so this pushes us to an extra bit on each record to support the extra abbrev kinds, which increases file size by ~1%. This patch *barely* pays for that through the other improvements, but we've got room for another 18 abbrevs, so we should be able to make it much more profitable with future changes. llvm-svn: 214024
* [PCH] Remove the BackingIvarReferencedInAccessor field from DECL_OBJC_IVAR ↵Argyrios Kyrtzidis2014-06-211-2/+0
| | | | | | | | abbreviation record. Patch by Yiding Jia! llvm-svn: 211438
* Recompute the injected class name type for a class template specializationRichard Smith2014-05-231-2/+0
| | | | | | rather than saving and restoring it. llvm-svn: 209557
* [C++11] Use 'nullptr'. Serialization edition.Craig Topper2014-05-221-11/+11
| | | | llvm-svn: 209392
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-061-2/+4
| | | | llvm-svn: 208077
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-191-3/+4
| | | | | | imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations. llvm-svn: 206680
* Fix PR18307: Properly (de)serialize inherited constructors and their using ↵Stephan Tolksdorf2014-03-271-0/+1
| | | | | | | | declarations Reviewed in http://llvm-reviews.chandlerc.com/D3102 llvm-svn: 204951
* If a name is injected into an imported inline namespace without reopening thatRichard Smith2014-03-231-3/+8
| | | | | | | namespace, we need to update both the visible names of that namespace and of its enclosing namespace set. llvm-svn: 204570
* When we inject a declaration into a namespace, add the primary DeclContext toRichard Smith2014-03-231-1/+2
| | | | | | | the update set rather than the current DeclContext. Add test for the local extern case too. llvm-svn: 204568
* If a template instantation introduces a name into a namespace, we need to writeRichard Smith2014-03-231-0/+12
| | | | | | | out a visible update record for that namespace even if it was never declared in this module. llvm-svn: 204554
* Emit an update record if we instantiate the definition of a function templateRichard Smith2014-03-221-0/+16
| | | | | | | | specialization from a module. (This can also happen for function template specializations in PCHs if they're instantiated eagerly, because they're constexpr or have a deduced return type.) llvm-svn: 204547
* Fixing code that doesn't compile in MSVC 2012 (but does in MSVC 2013) from ↵Aaron Ballman2014-03-211-1/+1
| | | | | | r204417 and related commits. llvm-svn: 204471
* Refactor and simplify DeclUpdates serialization.Richard Smith2014-03-201-3/+2
| | | | llvm-svn: 204397
* [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with ↵Aaron Ballman2014-03-141-3/+1
| | | | | | iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203958
* [C++11] Replacing OMPThreadPrivateDecl and OMPClause iterators ↵Aaron Ballman2014-03-141-4/+2
| | | | | | varlist_begin() and varlist_end() with iterator_range varlists(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203937
* [C++11] Replacing ObjCCategoryDecl iterators protocol_loc_begin() and ↵Aaron Ballman2014-03-141-4/+2
| | | | | | protocol_loc_end() with iterator_range protocol_locs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203923
* [C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-141-3/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203922
* [C++11] Replacing ObjCProtocolDecl iterators protocol_loc_begin() and ↵Aaron Ballman2014-03-141-4/+2
| | | | | | protocol_loc_end() with iterator_range protocol_locs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203919
* [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-3/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203863
* [C++11] Replacing ObjCInterfaceDecl iterators protocol_loc_begin() and ↵Aaron Ballman2014-03-131-4/+2
| | | | | | protocol_loc_end() with iterator_range protocol_locs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203847
* [C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-4/+2
| | | | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases. llvm-svn: 203842
* Renaming the chains() ranged iterator to chain() per suggestion by Richard ↵Aaron Ballman2014-03-071-1/+1
| | | | | | Smith. llvm-svn: 203262
* [C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() ↵Aaron Ballman2014-03-071-4/+2
| | | | | | with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203261
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-071-3/+2
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203255
* [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-3/+2
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203248
* Fix autolinking when modules are imported in pch filesBen Langmuir2014-01-311-7/+7
| | | | | | | | | | | | Add the ImportDecl to the set of interesting delcarations that are deserialized eagerly when an AST file is loaded (rather than lazily like most decls). This is required to get auto linking to work when there is no explicit import in the main file. Also resolve a FIXME to rename 'ExternalDefinitions', since that is only one of the things that need eager deserialization. The new name is 'EagerlyDeserializedDecls'. The corresponding AST bitcode is also renamed. llvm-svn: 200505
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-2/+2
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* [objc] Refactor and improve functionality for the -Wunused-property-ivar ↵Argyrios Kyrtzidis2014-01-031-2/+0
| | | | | | | | | | | | | | warning. - Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor - Don't check immediately after the method body is finished, check when the @implementation is finished. This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor. - Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self. rdar://15727325 llvm-svn: 198432
OpenPOWER on IntegriCloud