summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Factor out exception specification information fromRichard Smith2014-07-311-4/+5
| | | | | | | | FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care about the other ExtProtoInfo bits and just want to talk about the exception specification. llvm-svn: 214450
* [modules] PR20475: merging support for alias template declarations.Richard Smith2014-07-281-0/+3
| | | | llvm-svn: 214124
* [modules] Rearrange and unify the way we determine if we need to pull inRichard Smith2014-07-151-28/+30
| | | | | | | | | redeclaration chains when pulling in a declaration. We need the redecl chain unless we know some other declaration will trigger it to be pulled in; that happens if our originally-canonical declaration had all the knowledge that we have (and isn't us). llvm-svn: 213043
* [modules] When merging a class template, also merge the definition of its ↵Richard Smith2014-07-111-3/+20
| | | | | | pattern. llvm-svn: 212836
* [modules] Don't try to merge template specializations by performing name lookupRichard Smith2014-07-111-2/+5
| | | | | | | | | into their container; we won't find them there. These things are already being merged when they're added to their primary template's folding set, so this merging is redundant (and causes us to reject-valid because we think we've found an odr violation). llvm-svn: 212788
* Fix an iterator invalidation issue: deserializing a key function can write toRichard Smith2014-07-071-0/+3
| | | | | | | the key functions table. Don't hold references to anything within that table across such an access. llvm-svn: 212437
* Convert some function arguments to use ArrayRef.Craig Topper2014-06-261-2/+1
| | | | llvm-svn: 211764
* [modules] When we merge redecl chains or mark a decl used with an updateRichard Smith2014-06-161-1/+13
| | | | | | | record, mark all subsequent decls as 'used' too, to maintain the AST invariant that getPreviousDecl()->Used implies this->Used. llvm-svn: 211050
* When merging functions across modules (and in particular, instantiations ofRichard Smith2014-05-291-2/+37
| | | | | | | member functions), ensure that the redecl chain never transitions from 'inline' to 'not inline', since that violates an AST invariant. llvm-svn: 209794
* Recompute the injected class name type for a class template specializationRichard Smith2014-05-231-3/+1
| | | | | | rather than saving and restoring it. llvm-svn: 209557
* Avoid allocating extra memory to handle the lazy definition data pointer forRichard Smith2014-05-221-2/+2
| | | | | | CXXRecordDecls when modules is enabled. llvm-svn: 209482
* If a class template specialization from one module has its definitionRichard Smith2014-05-221-0/+10
| | | | | | | | | instantiated in another module, and the instantiation uses a partial specialization, include the partial specialization and its template arguments in the update record. We'll need them if someone imports the second module and tries to instantiate a member of the template. llvm-svn: 209472
* [C++11] Use 'nullptr'. Serialization edition.Craig Topper2014-05-221-19/+21
| | | | llvm-svn: 209392
* If two sibling modules declare the same entity, and we indirectly pull aRichard Smith2014-05-191-0/+23
| | | | | | | | declaration of that entity in from one of those modules, keep track of the fact that we've not completed the redeclaration chain yet so that we can pull the remaining declarations in from the other module if they're needed. llvm-svn: 209161
* If a declaration is loaded, and then a module import adds a redeclaration, thenRichard Smith2014-05-161-25/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ensure that querying the first declaration for its most recent declaration checks for redeclarations from the imported module. This works as follows: * The 'most recent' pointer on a canonical declaration grows a pointer to the external AST source and a generation number (space- and time-optimized for the case where there is no external source). * Each time the 'most recent' pointer is queried, if it has an external source, we check whether it's up to date, and update it if not. * The ancillary data stored on the canonical declaration is allocated lazily to avoid filling it in for declarations that end up being non-canonical. We'll still perform a redundant (ASTContext) allocation if someone asks for the most recent declaration from a decl before setPreviousDecl is called, but such cases are probably all bugs, and are now easy to find. Some finessing is still in order here -- in particular, we use a very general mechanism for handling the DefinitionData pointer on CXXRecordData, and a more targeted approach would be more compact. Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was addressing only a corner of the full problem space here. That's not covered by this patch. Early performance benchmarks show that this makes no measurable difference to Clang performance without modules enabled (and fixes a major correctness issue with modules enabled). I'll revert if a full performance comparison shows any problems. llvm-svn: 209046
* Refactor to avoid explicitly listing all the different flavours of redeclarableRichard Smith2014-05-131-56/+43
| | | | | | declarations, and duplicating code between them. llvm-svn: 208662
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-1/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-061-2/+8
| | | | llvm-svn: 208077
* Defer loading any pending update records until we've finished deserializing.Richard Smith2014-04-301-1/+1
| | | | | | | This fixes a bug where an update record causes us to load an entity that refers to an entity we've not finished loading yet, resulting in badness. llvm-svn: 207603
* When two templates get merged together, also merge their pattern declarationsRichard Smith2014-04-241-26/+91
| | | | | | | | | | | | | | together. This is extremely hairy, because in general we need to have loaded both the template and the pattern before we can determine whether either should be merged, so we temporarily violate the rule that all merging happens before reading a decl ends, but *only* in the case where a template's pattern is being loaded while loading the template itself. In order to accomodate this for class templates, delay loading the injected class name type for the pattern of the template until after we've loaded the template itself, if we happen to load the template first. llvm-svn: 207063
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-191-52/+208
| | | | | | 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
* Add missing serialization code for one of the CXXRecordDecl definition flags.Richard Smith2014-04-171-0/+1
| | | | llvm-svn: 206493
* Fix PR18307: Properly (de)serialize inherited constructors and their using ↵Stephan Tolksdorf2014-03-271-1/+3
| | | | | | | | declarations Reviewed in http://llvm-reviews.chandlerc.com/D3102 llvm-svn: 204951
* Remove redundant and misleading check. This could also lead to painful cyclicRichard Smith2014-03-251-1/+1
| | | | | | deserialization. llvm-svn: 204695
* If an update record makes a declaration interesting, pass it to the consumer.Richard Smith2014-03-231-1/+11
| | | | llvm-svn: 204550
* Emit an update record if we instantiate the definition of a function templateRichard Smith2014-03-221-0/+18
| | | | | | | | 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
* Serialize and deserialize mangling numbers.Richard Smith2014-03-211-0/+8
| | | | llvm-svn: 204423
* When the exception specification for a function in an imported PCH or module isRichard Smith2014-03-201-0/+11
| | | | | | resolved, emit an update record. llvm-svn: 204403
* Serialization: Directly compare objects instead of using a functor ↵Benjamin Kramer2014-03-151-38/+4
| | | | | | | | duplicating the compare operators. No functionality change. llvm-svn: 204006
* [C++11] Replacing ObjCInterfaceDecl iterators known_categories_begin() and ↵Aaron Ballman2014-03-131-6/+3
| | | | | | known_categories_end() with iterator_range known_categories(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203854
* Revert C++11ification in r203534 and r203536. Apparently our toolchains aren'tRichard Smith2014-03-111-3/+5
| | | | | | ready for this yet. llvm-svn: 203548
* If a visibility update record is found for a DeclContext after that Decl hasRichard Smith2014-03-111-7/+3
| | | | | | | already been loaded, apply that update record to the Decl immediately, rather than adding it to a pending list and never applying it. llvm-svn: 203534
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-4/+4
| | | | llvm-svn: 202639
* If a module A exports a macro M, and a module B imports that macro and #undef'sRichard Smith2014-03-011-1/+1
| | | | | | | | | | | | | | it, importers of B should not see the macro. This is complicated by the fact that A's macro could also be visible through a different path. The rules (as hashed out on cfe-commits) are included as a documentation update in this change. With this, the number of regressions in libc++'s testsuite when modules are enabled drops from 47 to 7. Those remaining 7 are also macro-related, and are due to remaining bugs in this change (in particular, the handling of submodules is imperfect). llvm-svn: 202560
* Fix PCH deserialization bug with local static symbols being treated as local ↵Ted Kremenek2014-02-111-1/+1
| | | | | | | | | | | | | extern. This triggered a miscompilation of code using Boost's function_template.hpp when it was included inside a PCH file. A local static within that header would be treated as local extern, resulting in the wrong mangling. This only occurred during PCH deserialization. Fixes <rdar://problem/15975816> and <rdar://problem/15926311>. llvm-svn: 201130
* Fix autolinking when modules are imported in pch filesBen Langmuir2014-01-311-1/+2
| | | | | | | | | | | | 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-3/+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
* ObjectiveC. Remove false positive warning for missing propertyFariborz Jahanian2014-01-021-0/+1
| | | | | | | backing ivar by not issuing this warning if ivar is referenced somewhere and accessor makes method calls. // rdar://15727325 llvm-svn: 198367
* PCH: fix a crash caused by a circular deserialization dependencyDmitri Gribenko2013-12-191-4/+7
| | | | | | | | | We started by trying to deserialize decltype(func-param) in a trailing return type, which causes the function parameter decl to be deserialized, which pulls in the function decl, which pulls the function type, which pulls the same decltype() in the return type, and then we crashed. llvm-svn: 197644
* Implement DR1460: fix handling of default initializers in unions; don't allowRichard Smith2013-12-101-0/+1
| | | | | | | | | more than one such initializer in a union, make mem-initializers override default initializers for other union members, handle anonymous unions with anonymous struct members better. Fix a couple of semi-related bugs exposed by the tests for same. llvm-svn: 196892
* [objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get theArgyrios Kyrtzidis2013-12-031-0/+1
| | | | | | | | | | designated initializers of an interface. If the interface declaration does not have methods marked as designated initializers then the interface inherits the designated initializers of its super class. llvm-svn: 196315
* Implement final resolution of DR1402: implicitly-declared move operators thatRichard Smith2013-11-041-2/+0
| | | | | | | | | | | would be deleted are still declared, but are ignored by overload resolution. Also, don't delete such members if a subobject has no corresponding move operation and a non-trivial copy. This causes us to implicitly declare move operations in more cases, but risks move-assigning virtual bases multiple times in some circumstances (a warning for that is to follow). llvm-svn: 193969
* ObjectiveC: under -Wunused-property-ivar warn if property'sFariborz Jahanian2013-10-251-0/+2
| | | | | | | backing warning is not used in one of its accessor methods. // rdar://14989999 llvm-svn: 193439
* A decl never becomes unused. Make that explicit in the API.Rafael Espindola2013-10-231-2/+2
| | | | llvm-svn: 193248
* Refactor out the circular reference to LambdaExpr in CXXRecordDecl.Faisal Vali2013-10-231-2/+4
| | | | | | | | | | | | | | | | | A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test. The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html. Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box). Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl. In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. No change in functionality. This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): http://llvm-reviews.chandlerc.com/D1856 Thanks! llvm-svn: 193246
* Revert r193223 and r193216.Rafael Espindola2013-10-231-4/+2
| | | | | | | | | | They were causing CodeGenCXX/mangle-exprs.cpp to fail. Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl." Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves." llvm-svn: 193226
* Remove the circular reference to LambdaExpr in CXXRecordDecl.Faisal Vali2013-10-231-2/+4
| | | | | | | | | | | | | | | Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl. No change in functionality. In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): http://llvm-reviews.chandlerc.com/D1856 Thanks! llvm-svn: 193223
* Make UsingShadowDecls redeclarable. This fixes some visibility problems withRichard Smith2013-10-231-1/+15
| | | | | | | | | | modules. With this fixed, I no longer see any test regressions in the libc++ test suite when enabling a single-module module.map for libc++ (other than issues with my system headers). llvm-svn: 193219
* Basic ODR checking for C++ modules:Richard Smith2013-10-181-3/+12
| | | | | | | | | | | | | | | If we have multiple definitions of the same entity from different modules, we nominate the first definition which we see as being the canonical definition. If we load a declaration from a different definition and we can't find a corresponding declaration in the canonical definition, issue a diagnostic. This is insufficient to prevent things from going horribly wrong in all cases -- we might be in the middle of emitting IR for a function when we trigger some deserialization and discover that it refers to an incoherent piece of the AST, by which point it's probably too late to bail out -- but we'll at least produce a diagnostic. llvm-svn: 192950
OpenPOWER on IntegriCloud