summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] When merging the pattern of a class template definition into a priorRichard Smith2015-03-111-0/+1
| | | | | | | | | | definition, be sure to update the definition data on all declarations, not just the canonical one, since the pattern might not be in the list of pending definitions (if it used to be canonical itself). One-line fix by me; reduced testcase by Daniel Jasper! llvm-svn: 231950
* [modules] Avoid accidentally completing the redeclaration chain when updatingRichard Smith2015-03-111-0/+4
| | | | | | | all the existing declarations of a record-like entity with a pointer to its definition. llvm-svn: 231901
* [modules] Don't bother looking up a declaration to merge into if we're notRichard Smith2015-03-101-1/+6
| | | | | | actually loading a formerly-canonical declaration. llvm-svn: 231742
* PR21687: when adding a redeclaration of a function with an implicit exceptionRichard Smith2015-03-101-6/+15
| | | | | | | | | specification, update all prior declarations if the new one has an explicit exception specification and the prior ones don't. Patch by Vassil Vassilev! Some minor tweaking and test case by me. llvm-svn: 231738
* [modules] Don't clobber a destructor's operator delete when adding another one;Richard Smith2015-03-101-5/+17
| | | | | | | 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-71/+29
| | | | | | | | | | | | | | | | | | | | | | 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] Avoid adding a redecl chain to the 'pending out of date' list as theRichard Smith2015-02-281-4/+34
| | | | | | very first step in updating it. llvm-svn: 230840
* [modules] Deduplicate when merging lists of template specializations from ↵Richard Smith2015-02-281-8/+8
| | | | | | imported modules. llvm-svn: 230834
* [modules] When writing out a list of specializations for a template, if we haveRichard Smith2015-02-271-6/+0
| | | | | | | | 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] For an inheriting constructor, the inherited constructor is stored inRichard Smith2015-02-271-1/+2
| | | | | | | a map keyed off the canonical declaration. Don't try to set it if we're loading some non-canonical merged declaration. llvm-svn: 230716
* [modules] When loading in multiple canonical definitions of a template,Richard Smith2015-02-271-58/+43
| | | | | | | accumulate the set of specializations rather than overwriting one list with another. llvm-svn: 230712
* Make RedeclarableResult's ownership-transferring constructor be a moveRichard Smith2015-02-251-4/+4
| | | | | | constructor. llvm-svn: 230417
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-2/+2
| | | | | | requiring the macro. NFC; Clang edition. llvm-svn: 229339
* [modules] When collecting declarations to complete a redeclaration chain for anRichard Smith2015-02-121-12/+18
| | | | | | | | | | entity, put the originally-canonical decl IDs in the right places in the redecl chain rather than reordering them all to the start. If we don't ensure that the redecl chain order is consistent with the topological module order, we can fail to make a declaration visible if later declarations are in more IDNSs than earlier ones (for instance, because the earlier decls are invisible friends). llvm-svn: 228978
* [modules] Treat friend declarations that are lexically within a dependentRichard Smith2015-02-071-15/+7
| | | | | | | 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
* [modules] If a module declares an entity and then imports another declarationRichard Smith2015-02-061-12/+29
| | | | | | | | | 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
* [modules] When using -E, we may try to merge decls despite having no SemaRichard Smith2015-02-041-0/+5
| | | | | | | | | | | object. In such a case, use the TU's DC for merging global decls rather than giving up when we find there is no TU scope. Ultimately, we should probably avoid all loading of decls when preprocessing, but there are other reasonable use cases for loading an AST file with no Sema object for which this is the right thing. llvm-svn: 228234
* [modules] If we already have a fake definition for one declaration of a class,Richard Smith2015-02-041-1/+2
| | | | | | | don't think we're providing a new one in an update record adding a definition to another declaration of the same class. llvm-svn: 228104
* [modules] Be sure to load the lexical definition of a class templateRichard Smith2015-02-031-13/+22
| | | | | | | specialization from an update record exactly once, even if we needed to fake up the definition. llvm-svn: 227939
* [modules] Sometimes we can deserialize a class member but not have yetRichard Smith2015-01-241-21/+56
| | | | | | | | | | | encountered any definition for the class; this happens when the definition is added by an update record that is not yet loaded. In such a case, eagerly pick the original parent of the member as the canonical definition of the class rather than muddling through with the canonical declaration (the latter can lead to us failing to merge properly later if the canonical definition turns out to be some other declaration). llvm-svn: 226977
* [modules] If we add an implicit special member to a class through an updateRichard Smith2015-01-221-1/+13
| | | | | | | | record, and that class declaration is not the canonical definition of the class, be sure to add the class to the list of classes that are consulted when we look up a special member in the canonical definition. llvm-svn: 226778
* [modules] If we load two declarations with typedef names for linkage purposesRichard Smith2015-01-221-4/+10
| | | | | | | on top of a local declaration of the same entity, we still need to remember that we loaded the first one or we may fail to merge the second one properly. llvm-svn: 226765
* [modules] It's possible to merge into the pattern of a class template before weRichard Smith2015-01-221-3/+7
| | | | | | | load the definition data from the declaration itself. In that case, merge properly; don't assume the prior definition is the same as our own. llvm-svn: 226761
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-191-1/+1
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* PR21437, final part of DR1330: delay-parsing of exception-specifications. ThisRichard Smith2014-11-131-4/+2
| | | | | | | is a re-commit of Doug's r154844 (modernized and updated to fit into current Clang). llvm-svn: 221918
* [OPENMP] Codegen for threadprivate variablesAlexey Bataev2014-11-111-1/+6
| | | | | | | | | For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>); In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>); Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info. Differential Revision: http://reviews.llvm.org/D4002 llvm-svn: 221663
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-221-2/+3
| | | | | | | | | | | | | | | Implicit module builds are not well-suited to a lot of build systems. In particular, they fare badly in distributed build systems, and they lead to build artifacts that are not tracked as part of the usual dependency management process. This change allows explicitly-built module files (which are already supported through the -emit-module flag) to be explicitly loaded into a build, allowing build systems to opt to manage module builds and dependencies themselves. This is only the first step in supporting such configurations, and it should be considered experimental and subject to change or removal for now. llvm-svn: 220359
* [modules] Merging for class-scope using-declarations.Richard Smith2014-10-141-0/+68
| | | | llvm-svn: 219657
* [modules] Delay loading the field declared with an anonymous tag declarationRichard Smith2014-10-101-1/+1
| | | | | | until after we've had a chance to merge that tag. llvm-svn: 219539
* Change how we distinguish bitfield widths, in-classJohn McCall2014-10-101-4/+5
| | | | | | | | 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-7/+14
| | | | | | | merging of namespace aliases across modules and improves source fidelity. Incidentally also fixes PR20816. llvm-svn: 217103
* [modules] Fix deserialization cycle when loading a tag declaration with a ↵Richard Smith2014-08-301-49/+58
| | | | | | 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-1/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
* [modules] Number anonymous declarations that are lexically within mergeableRichard Smith2014-08-281-19/+92
| | | | | | 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/+3
| | | | | | | | 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] Don't assert when merging virtual functions that override otherRichard Smith2014-08-261-5/+12
| | | | | | | functions. Also don't needlessly pull in non-canonical declarations of the overridden virtual functions. llvm-svn: 216503
* [modules] Track the described template in an alias declaration that is theRichard Smith2014-08-261-5/+12
| | | | | | | pattern of an alias template declaration. Use this to merge alias templates properly when they're members of class template specializations. llvm-svn: 216437
* Fix typo.Richard Smith2014-08-251-1/+1
| | | | llvm-svn: 216417
* [modules] Fix false report of an ODR violation when merging friendRichard Smith2014-08-251-1/+3
| | | | | | | | | | declarations. We can't expect to find them in the canonical definition of the class, because that's not where they live. This means we no longer reject real ODR violations with friend declarations, but we weren't consistently doing so anyway. llvm-svn: 216369
* [modules] When merging a tag declaration that has a typedef name for linkageRichard Smith2014-08-231-7/+66
| | | | | | | purposes, look for other typedefs with that same name and merge into their named tag declaration if there is one. llvm-svn: 216312
* Fix the rececl chain for redeclarations of predefined declsBen Langmuir2014-08-181-0/+2
| | | | | | | | | Predefined decls like 'Protocol' in objc are not loaded from AST files, so we cannot rely on loading the canonical decl to complete the redecl chain for redeclarations of these decls. The broken redecl chain was non-circular, so looping over redecls() would hang. llvm-svn: 215929
* Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid ↵Craig Topper2014-08-171-4/+4
| | | | | | needing to mention the size. llvm-svn: 215869
* [modules] Turn off a broken optimization: we need to pick up implicit specialRichard Smith2014-08-141-2/+5
| | | | | | | members from all redefinitions of a class that have them, in case the special member is defined in one module but only declared in another. llvm-svn: 215675
* [modules] Don't assert if the same imported class template specializationRichard Smith2014-08-141-2/+13
| | | | | | | declaration has its definition instantiated in two sibling modules and they use a partial specialization. llvm-svn: 215616
* [modules] When performing a lookup into a namespace, ensure that any laterRichard Smith2014-08-131-2/+2
| | | | | | | | | | redefinitions of that namespace have already been loaded. When writing out the names in a namespace, if we see a name that is locally declared and had imported declarations merged on top of it, export the local declaration as the lookup result, because it will be the most recent declaration of that entity in the redeclaration chain of an importer of the module. llvm-svn: 215518
* [modules] Don't defer performing updates if we have incomplete redecl chains.Richard Smith2014-08-071-21/+38
| | | | | | Instead, perform them carefully immediately. llvm-svn: 215147
* [modules] When emitting an update record containing the body of a destructor,Richard Smith2014-08-071-1/+5
| | | | | | | | | also emit the updated 'operator delete' looked up for that destructor. Switch from UpdateDecl to an actual update record when this happens due to implicitly defining a special member function and unify this code path and the one for instantiating a function definition. llvm-svn: 215132
* [modules] Remove IRGen special case for emitting implicit special members ifRichard Smith2014-08-011-0/+2
| | | | | | | | | | | they're somehow missing a body. Looks like this was left behind when the loop was generalized, and it's not been problematic before because without modules, a used, implicit special member function declaration must be a definition. This was resulting in us trying to emit a constructor declaration rather than a definition, and producing a constructor missing its member initializers. llvm-svn: 214473
* Fix buildbot: work around missing GCC C++11 feature.Richard Smith2014-07-311-0/+2
| | | | llvm-svn: 214459
* [modules] Maintain an AST invariant across module load/save: if any declarationRichard Smith2014-07-311-42/+113
| | | | | | | | | | | | | | | of a function has a resolved exception specification, then all declarations of the function do. We should probably improve the AST representation to make this implicit (perhaps only store the exception specification on the canonical declaration), but this fixes things for now. The testcase for this (which used to assert) also exposes the actual bug I was trying to reduce here: we sometimes fail to emit the body of an imported special member function definition. Fix for that to follow. llvm-svn: 214458
OpenPOWER on IntegriCloud