summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Added source locs for angled parentheses in class/var template partial specs.Enea Zaffanella2013-08-101-18/+2
| | | | llvm-svn: 188134
* PR9992: Serialize and deserialize the token sequence for a function template inRichard Smith2013-08-071-0/+1
| | | | | | -fdelayed-template-parsing mode. Patch by Will Wilson! llvm-svn: 187916
* Eliminate CXXConstructorDecl::IsImplicitlyDefined.Jordan Rose2013-08-071-2/+0
| | | | | | | | | | | | This field is just IsDefaulted && !IsDeleted; in all places it's used, a simple check for isDefaulted() is superior anyway, and we were forgetting to set it in a few cases. Also eliminate CXXDestructorDecl::IsImplicitlyDefined, for the same reasons. No intended functionality change. llvm-svn: 187891
* Started implementing variable templates. Top level declarations should be ↵Larisse Voufo2013-08-061-2/+139
| | | | | | fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention... llvm-svn: 187762
* When merging redeclaration chains across modules, if a declaration is visibleRichard Smith2013-08-021-6/+12
| | | | | | | | | | | | | | | | | | | in one module but is only declared as a friend in another module, keep it visible in the result of the merge. This is incomplete on two axes: 1) Our handling of local extern declarations is basically broken (we put them in the wrong decl context, and don't find them in redeclaration lookup, unless they've previously been declared), and this results in them making friends visible after a merge. 2) Eventually we'll need to mark that this has happened, and more carefully check whether a declaration should be visible if it was only visible in some of the modules in which it was declared. Fortunately it's rare for the identifier namespace of a declaration to change along its redeclaration chain. llvm-svn: 187639
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-221-2/+2
| | | | | | | | | | | | No functionality change. In Sema helper functions: * renamed isTypeName as HasTypenameKeyword In UsingDecl: * renamed get/setUsingLocation to get/setUsingLoc * renamed is/setTypeName as has/setTypename llvm-svn: 186816
* Serialization support for TagDecl::IsCompleteDefinitionRequiredDavid Blaikie2013-07-141-0/+1
| | | | | | Requested by Richard Smith in post-commit review of r186262 llvm-svn: 186266
* C++ modules: Don't call DeclContext::lookup when half-way through deserializingRichard Smith2013-07-131-15/+13
| | | | | | | decls. That can reenter deserialization and explode horribly by trying to merge a declaration that we've not got very far through deserializing yet. llvm-svn: 186236
* Lazily deserialize function template specializations. This fixes a cycle inRichard Smith2013-06-281-10/+20
| | | | | | module deserialization / merging, and more laziness here is general goodness. llvm-svn: 185132
* Lazily deserialize the "first' friend declaration when deserializing a classRichard Smith2013-06-261-1/+1
| | | | | | | declaration. This PCH a little lazier, and breaks a deserialization cycle that causes crashes with modules enabled. llvm-svn: 184904
* Fix deserializing of class template partial specializations. Assign sequenceRichard Smith2013-06-251-5/+6
| | | | | | | | | | numbers as we deserialize class template partial specializations. We can't assume that the old sequence numbers will work. The sequence numbers are still deterministic, but are now a lot less predictable for class template partial specializations in modules/PCH. llvm-svn: 184811
* Check for matching template-parameter-lists when merging template declarations.Richard Smith2013-06-241-3/+52
| | | | llvm-svn: 184791
* Slightly improve cross-module merging for function templates.Richard Smith2013-06-241-7/+12
| | | | llvm-svn: 184689
* Improved source code fidelity for gcc mode attribute.Enea Zaffanella2013-06-201-2/+6
| | | | llvm-svn: 184417
* Fix linkage computation for derived types in inline functions.Rafael Espindola2013-05-251-5/+3
| | | | | | | | | | | | | | | | | John noticed that the fix for pr15930 (r181981) didn't handle indirect uses of local types. For example, a pointer to local struct, or a function that returns it. One way to implement this would be to recursively look for local types. This would look a lot like the linkage computation itself for types. To avoid code duplication and utilize the existing linkage cache, this patch just makes the computation of "type with no linkage but externally visible because it is from an inline function" part of the linkage computation itself. llvm-svn: 182711
* Fix bitcode desynchronization when loading a PCH containing a class templateRichard Smith2013-05-231-15/+38
| | | | | | | | | | | specialization with modules enabled. Just don't merge them at all for now; we'll revisit this when support for template merging is added. In passing, make Decl::dump() a little safer to use with PCH/modules, by making it not deserialize any additional declarations. From a debugger you can call decls_begin() or similar first if you want to dump all child decls. llvm-svn: 182544
* First pass of semantic analysis for init-captures: check the initializer, buildRichard Smith2013-05-161-3/+16
| | | | | | | | | | | | | a FieldDecl from it, and propagate both into the closure type and the LambdaExpr. You can't do much useful with them yet -- you can't use them within the body of the lambda, because we don't have a representation for "the this of the lambda, not the this of the enclosing context". We also don't have support or a representation for a nested capture of an init-capture yet, which was intended to work despite not being allowed by the current standard wording. llvm-svn: 181985
* OpenMP threadprivate with qualified names.Alexey Bataev2013-05-131-2/+2
| | | | llvm-svn: 181683
* Cleanup handling of UniqueExternalLinkage.Rafael Espindola2013-05-131-2/+2
| | | | | | | | | | | | | This patch renames getLinkage to getLinkageInternal. Only code that needs to handle UniqueExternalLinkage specially should call this. Linkage, as defined in the c++ standard, is provided by getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage. Most places in the compiler actually want isExternallyVisible, which handles UniqueExternalLinkage as internal. llvm-svn: 181677
* C++1y deduced return types: when we deduce a return type for a function whichRichard Smith2013-05-111-0/+7
| | | | | | | we loaded from PCH, if we're building another PCH, create an update record to patch the return type of the earlier declaration. llvm-svn: 181659
* In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella2013-05-041-1/+1
| | | | llvm-svn: 181113
* Serialization for captured statementsBen Langmuir2013-05-031-3/+6
| | | | | | | | | | | Add serialization for captured statements and captured decls. Also add a const_capture_iterator to CapturedStmt. Test contributed by Wei Pan Differential Revision: http://llvm-reviews.chandlerc.com/D727 llvm-svn: 181048
* Keep track of an @implementation's super class name location, if one was ↵Argyrios Kyrtzidis2013-05-031-0/+1
| | | | | | provided. llvm-svn: 181039
* Sema for Captured StatementsTareq A. Siraj2013-04-161-0/+8
| | | | | | | | | | | | | Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic analysis. Currently captures all variables by reference. TODO: templates Author: Ben Langmuir <ben.langmuir@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D433 llvm-svn: 179618
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+10
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-131-1/+1
| | | | | | the AST. llvm-svn: 179447
* Pare back r164351 somewhat. The problem that change was addressing was that weRichard Smith2013-04-031-4/+0
| | | | | | | | don't serialize a lookup map for the translation unit outside C++ mode, so we can't tell when lookup within the TU needs to look within modules. Only apply the fix outside C++ mode, and only to the translation unit. llvm-svn: 178706
* Add 178663 back.Rafael Espindola2013-04-031-4/+2
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-2/+4
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-4/+2
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev2013-03-221-0/+15
| | | | llvm-svn: 177705
* [Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han2013-02-221-0/+8
| | | | | | | | Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. llvm-svn: 175900
* Ensure that the identifier chains have the most recent declaration after ↵Douglas Gregor2013-02-181-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | module deserialization. This commit introduces a set of related changes to ensure that the declaration that shows up in the identifier chain after deserializing declarations with a given identifier is, in fact, the most recent declaration. The primary change involves waiting until after we deserialize and wire up redeclaration chains before updating the identifier chains. There is a minor optimization in here to avoid recursively deserializing names as part of looking to see whether top-level declarations for a given name exist. A related change that became suddenly more urgent is to property record a merged declaration when an entity first declared in the current translation unit is later deserialized from a module (that had not been loaded at the time of the original declaration). Since we key off the canonical declaration (which is parsed, not from an AST file) for emitted redeclarations, we simply record this as a merged declaration during AST writing and let the readers merge them. Re-fixes <rdar://problem/13189985>, presumably for good this time. llvm-svn: 175447
* [PCH] Deserializing the DeclContext of a template parameter is not safeArgyrios Kyrtzidis2013-02-161-13/+5
| | | | | | | | | | | until recursive loading is finished. Otherwise we may end up with a template trying to deserialize a template parameter that is in the process of getting loaded. rdar://13135282 llvm-svn: 175329
* Fix a bug reduced from a crash when trying to use modules with libc++. We checkRichard Smith2013-02-121-0/+4
| | | | | | | | the linkage of functions and variables while merging declarations from modules, and we don't necessarily have enough of the rest of the AST loaded at that point to allow us to compute linkage, so serialize it instead. llvm-svn: 174943
* Fix handling of module imports adding names to a DeclContext after qualifiedRichard Smith2013-02-071-4/+11
| | | | | | | | | | | | | | | | name lookup has been performed in that context (this probably only happens in C++). 1) Whenever we add names to a context, set a flag on it, and if we perform lookup and discover that the context has had a lookup table built but has the flag set, update all entries in the lookup table with additional names from the external source. 2) When marking a DeclContext as having external visible decls, mark the context in which lookup is performed, not the one we are adding. These won't be the same if we're adding another copy of a pre-existing namespace. llvm-svn: 174577
* Added outer template parameter lists to friend type AST nodes.Enea Zaffanella2013-01-311-4/+6
| | | | llvm-svn: 174050
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-251-0/+1
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* When deserializing a declaration, don't look for redeclarations if itsDouglas Gregor2013-01-211-14/+11
| | | | | | | kind indicates that it can never be redeclared. Good for a 1% speedup, and redeclaration searching drops off the profile. llvm-svn: 173054
* update to use the new BitcodeCursor readRecord that takes a StringRef blob ↵Chris Lattner2013-01-201-2/+2
| | | | | | | | parameter, and adopt "advance" in more places. llvm-svn: 172951
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-161-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-2/+2
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as ↵David Blaikie2012-12-191-4/+5
| | | | | | | | | | | | | | | per review discussion in r170365 This does limit these typedefs to being sequences, but no current usage requires them to be contiguous (we could expand this to a more general iterator pair range concept at some point). Also, it'd be nice if SmallVector were constructible directly from an ArrayRef but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the inverse conversion. (& generalizing over all range-like things, while nice, would require some nontrivial SFINAE I haven't thought about yet) llvm-svn: 170482
* Finish implementing 'selected constructor' rules for triviality in C++11. InRichard Smith2012-12-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | the cases where we can't determine whether special members would be trivial while building the class, we eagerly declare those special members. The impact of this is bounded, since it does not trigger implicit declarations of special members in classes which merely *use* those classes. In order to determine whether we need to apply this rule, we also need to eagerly declare move operations and destructors in cases where they might be deleted. If a move operation were supposed to be deleted, it would instead be suppressed, and we could need overload resolution to determine if we fall back to a trivial copy operation. If a destructor were implicitly deleted, it would cause the move constructor of any derived classes to be suppressed. As discussed on cxx-abi-dev, C++11's selected constructor rules are also retroactively applied as a defect resolution in C++03 mode, in order to identify that class B has a non-trivial copy constructor (since it calls A's constructor template, not A's copy constructor): struct A { template<typename T> A(T &); }; struct B { mutable A a; }; llvm-svn: 169673
* Implement C++03 [dcl.init]p5's checking for value-initialization of referencesRichard Smith2012-12-081-0/+1
| | | | | | | | properly, rather than faking it up by pretending that a reference member makes the default constructor non-trivial. That leads to rejects-valids when putting such types inside unions. llvm-svn: 169662
* Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a bodyArgyrios Kyrtzidis2012-12-061-0/+2
| | | | | | that was skipped by the parser. llvm-svn: 169531
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-6/+6
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Refactor to reduce duplication in handling of special member functions. No ↵Richard Smith2012-11-301-18/+4
| | | | | | functionality change. llvm-svn: 168977
* Store on the CXXRecordDecl whether the class has, or would have, a copyRichard Smith2012-11-281-0/+4
| | | | | | | constructor/assignment operator with a const-qualified parameter type. The prior method for determining this incorrectly used overload resolution. llvm-svn: 168775
* [PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType typeArgyrios Kyrtzidis2012-11-061-2/+2
| | | | | | | | | | | | | | | | | reference instead of relying on computing it. In general, if storage is no issue, it is preferable to deserialize info from the PCH instead of trying to recompute it after the PCH was loaded. The incentive to change this now was due to r155303 changing how friend template classes in dependent contexts are handled; such classes can now be chained to a previous template class but the computed InjectedClassNameType may be different due to the extra template parameters from the dependent context. The new handling requires more investigation but, in the meantime, writing out InjectedClassNameType fixes PCH issue in rdar://12627738. llvm-svn: 167425
OpenPOWER on IntegriCloud