summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* OpenMP: Data-sharing attributes analysis and clause 'shared'Alexey Bataev2013-09-032-0/+22
| | | | llvm-svn: 189795
* Don't eagerly load all conversion operators when loading a class declarationRichard Smith2013-08-302-5/+5
| | | | | | from a PCH/module. llvm-svn: 189646
* Map from local decl IDs to global decl IDs when lazily deserializing friend ↵Richard Smith2013-08-301-3/+3
| | | | | | decl chains. llvm-svn: 189629
* Be lazier when loading KeyFunctions from PCH/modules. We don't need to loadRichard Smith2013-08-291-3/+3
| | | | | | | | | | | | | | these in eagerly if we're not actually processing a translation unit. The added laziness here also avoids us loading in parts of a CXXRecordDecl earlier than an upcoming class template specialization merging patch would like. Ideally, we should mark the vtable as used when we see a definition for the key function, rather than having a separate pass over dynamic classes at the end of the TU. The existing approach is pretty bad for PCH/modules, since it forcibly loads the declarations of all key functions in all imported modules, whether or not those key functions are defined. llvm-svn: 189627
* This wasn't headers, just missing namespaces.Benjamin Kramer2013-08-242-4/+2
| | | | | | /me bows head in shame. llvm-svn: 189172
* Add missing includes.Benjamin Kramer2013-08-242-1/+3
| | | | llvm-svn: 189171
* Replace compLocDecl with less_first.Benjamin Kramer2013-08-241-6/+1
| | | | llvm-svn: 189170
* A clean-up pass, exploring the unification of traversals of class, variable ↵Larisse Voufo2013-08-231-0/+13
| | | | | | and function templates. llvm-svn: 189152
* Use pop_back_val() instead of both back() and pop_back().Robert Wilhelm2013-08-232-6/+4
| | | | | | No functionality change intended. llvm-svn: 189112
* Remove SequenceNumber from class/variable template partial specializations.Richard Smith2013-08-221-4/+0
| | | | | | | | This was only used to ensure that the traversal order was the same as the insertion order, but that guarantee was already being provided by the use of a FoldingSetVector. llvm-svn: 189075
* Revert "Implement a rudimentary form of generic lambdas."Manuel Klimek2013-08-223-6/+1
| | | | | | This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7. llvm-svn: 189004
* Implement a rudimentary form of generic lambdas.Faisal Vali2013-08-223-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, the following features are not included in this commit: - any sort of capturing within generic lambdas - nested lambdas - conversion operator for captureless lambdas - ensuring all visitors are generic lambda aware As an example of what compiles: template <class F1, class F2> struct overload : F1, F2 { using F1::operator(); using F2::operator(); overload(F1 f1, F2 f2) : F1(f1), F2(f2) { } }; auto Recursive = [](auto Self, auto h, auto ... rest) { return 1 + Self(Self, rest...); }; auto Base = [](auto Self, auto h) { return 1; }; overload<decltype(Base), decltype(Recursive)> O(Base, Recursive); int num_params = O(O, 5, 3, "abc", 3.14, 'a'); Please see attached tests for more examples. Some implementation notes: - Add a new Declarator context => LambdaExprParameterContext to clang::Declarator to allow the use of 'auto' in declaring generic lambda parameters - Augment AutoType's constructor (similar to how variadic template-type-parameters ala TemplateTypeParmDecl are implemented) to accept an IsParameterPack to encode a generic lambda parameter pack. - Add various helpers to CXXRecordDecl to facilitate identifying and querying a closure class - LambdaScopeInfo (which maintains the current lambda's Sema state) was augmented to house the current depth of the template being parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth) so that Sema::ActOnLambdaAutoParameter may use it to create the appropriate list of corresponding TemplateTypeParmDecl for each auto parameter identified within the generic lambda (also stored within the current LambdaScopeInfo). Additionally, a TemplateParameterList data-member was added to hold the invented TemplateParameterList AST node which will be much more useful once we teach TreeTransform how to transform generic lambdas. - SemaLambda.h was added to hold some common lambda utility functions (this file is likely to grow ...) - Teach Sema::ActOnStartOfFunctionDef to check whether it is being called to instantiate a generic lambda's call operator, and if so, push an appropriately prepared LambdaScopeInfo object on the stack. - Teach Sema::ActOnStartOfLambdaDefinition to set the return type of a lambda without a trailing return type to 'auto' in C++1y mode, and teach the return type deduction machinery in SemaStmt.cpp to process either C++11 and C++14 lambda's correctly depending on the flag. - various tests were added - but much more will be needed. A greatful thanks to all reviewers including Eli Friedman, James Dennett and the ever illuminating Richard Smith. And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified! Thanks! llvm-svn: 188977
* Properly track l-paren of a CXXFucntionalCastExpr.Eli Friedman2013-08-152-2/+2
| | | | | | | | | | In addition to storing more useful information in the AST, this fixes a semantic check in template instantiation which checks whether the l-paren location is valid. Fixes PR16903. llvm-svn: 188495
* Bug fix: disallow a variable template to be redeclared as a non-templated ↵Larisse Voufo2013-08-142-9/+27
| | | | | | variable llvm-svn: 188350
* Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:Richard Smith2013-08-132-0/+5
| | | | | | | | | | | | | When a local extern declaration redeclares some other entity, the type of that entity is merged with the prior type if the prior declaration is visible (in C) or is declared in the same scope (in C++). - Make LookupRedeclarationWithLinkage actually work in C++, use it in the right set of cases, and make it track whether it found a shadowed declaration. - Track whether we found a declaration in the same scope (for C++) including across serialization and template instantiation. llvm-svn: 188307
* variable templates updated for PCH serialization... Still working on test ↵Larisse Voufo2013-08-131-0/+1
| | | | | | cases... llvm-svn: 188249
* Added source locs for angled parentheses in class/var template partial specs.Enea Zaffanella2013-08-104-28/+28
| | | | llvm-svn: 188134
* Expose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.James Dennett2013-08-092-3/+6
| | | | | | | | | | | | | | | | | | | | | Summary: Source-centric tools need access to the location of a C++11 lambda expression's capture-default ('&' or '=') when it's present. It's possible for them to find it by re-lexing and re-implementing rules that Clang's parser has already applied, but the cost of storing the SourceLocation and making it available to them is 32 bits per LambdaExpr (a small delta, proportionally), and the simplification in client code is significant. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits, klimek, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1192 llvm-svn: 188121
* PR9992: Serialize and deserialize the token sequence for a function template inRichard Smith2013-08-074-2/+58
| | | | | | -fdelayed-template-parsing mode. Patch by Will Wilson! llvm-svn: 187916
* [PCH] Fix a PCH serialization crash, with invalid code related to forward ↵Argyrios Kyrtzidis2013-08-071-0/+15
| | | | | | | | | | | | | | | | enum references. The problem was that an enum without closing semicolon could be associated as a forward enum in an erroneous declaration, leading to the identifier being associated with the enum decl but without a declaration actually referencing it. This resulted in not having it serialized before serializing the identifier that is associated with. Also prevent the ASTUnit from querying the serialized DeclID for an invalid top-level decl; it may not have been serialized. rdar://14539667 llvm-svn: 187914
* Eliminate CXXConstructorDecl::IsImplicitlyDefined.Jordan Rose2013-08-072-4/+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-064-2/+243
| | | | | | 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
* Fix read of uninitialized enum value in test, caught by UBSan. No functionalityRichard Smith2013-07-312-1/+3
| | | | | | change, other than removal of undefined behavior. llvm-svn: 187465
* Make modules depend on the compiler's own module.map, as a proxy for the ↵Douglas Gregor2013-07-221-2/+17
| | | | | | | | | | | compiler itself. The headers in the compiler's own resource include directory are system headers, which means we don't stat() them eagerly when loading a module. Use module.map as a proxy for these headers and the compiler itself. Fixes <rdar://problem/13856838>. llvm-svn: 186870
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-222-4/+4
| | | | | | | | | | | | 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
* Make IgnoreParens() look through ChooseExprs.Eli Friedman2013-07-202-0/+2
| | | | | | | | | | | | | This is the same way GenericSelectionExpr works, and it's generally a more consistent approach. A large part of this patch is devoted to caching the value of the condition of a ChooseExpr; it's needed to avoid threading an ASTContext into IgnoreParens(). Fixes <rdar://problem/14438917>. llvm-svn: 186738
* OpenMP: basic support for #pragma omp parallelAlexey Bataev2013-07-192-1/+146
| | | | llvm-svn: 186647
* Serialization support for TagDecl::IsCompleteDefinitionRequiredDavid Blaikie2013-07-142-0/+4
| | | | | | 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
* Simplify GetBuiltinNames by hoising the NoBuiltins argument out of it.Eli Bendersky2013-07-111-2/+3
| | | | llvm-svn: 186106
* Use llvm::sys::fs::createUniqueFile.Rafael Espindola2013-07-051-1/+2
| | | | | | | Include a test that clang now produces output files with permissions matching the umask. llvm-svn: 185727
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-051-1/+1
| | | | llvm-svn: 185715
* Use typedef for Densemap contraining SmallVector passed to a function to ↵Craig Topper2013-07-051-6/+4
| | | | | | avoid repeating SmallVector size. llvm-svn: 185683
* Add typedefs for Densemaps containing SmallVectors to avoid repeating the ↵Craig Topper2013-07-051-8/+10
| | | | | | SmallVector size when creating iterators for the DenseMap. llvm-svn: 185682
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-041-4/+4
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185610
* 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-262-2/+2
| | | | | | | 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-252-7/+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
* [AST] Introduce a new DecayedType sugar nodeReid Kleckner2013-06-242-0/+23
| | | | | | | | | | | | | | The goal of this sugar node is to be able to look at an arbitrary FunctionType and tell if any of the parameters were decayed from an array or function type. Ultimately this is necessary to implement Microsoft's C++ name mangling scheme, which mangles decayed arrays differently from normal pointers. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1014 llvm-svn: 184763
* Slightly improve cross-module merging for function templates.Richard Smith2013-06-241-7/+12
| | | | llvm-svn: 184689
* This patch adds new private headers to the module map. PrivateLawrence Crowl2013-06-202-5/+35
| | | | | | | headers may be included from within the module, but not from outside the module. llvm-svn: 184471
* Improved source code fidelity for gcc mode attribute.Enea Zaffanella2013-06-202-3/+10
| | | | llvm-svn: 184417
* PR12086, PR15117Richard Smith2013-06-123-2/+17
| | | | | | | | | | | | | | | | | | | Introduce CXXStdInitializerListExpr node, representing the implicit construction of a std::initializer_list<T> object from its underlying array. The AST representation of such an expression goes from an InitListExpr with a flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr). This more detailed representation has several advantages, the most important of which is that the new MaterializeTemporaryExpr allows us to directly model lifetime extension of the underlying temporary array. Using that, this patch *drastically* simplifies the IR generation of this construct, provides IR generation support for nested global initializer_list objects, fixes several bugs where the destructors for the underlying array would accidentally not get invoked, and provides constant expression evaluation support for std::initializer_list objects. llvm-svn: 183872
* Include Path.h instead of PathV2.h.Rafael Espindola2013-06-112-2/+2
| | | | | | I am about to move PathV2.h to Path.h. llvm-svn: 183795
* [libclang] Allow building a precompiled preamble with compiler errorsArgyrios Kyrtzidis2013-06-111-4/+13
| | | | | | | | | | | A while ago we allowed libclang to build a PCH that had compiler errors; this was to retain the performance afforded by a PCH even if the user's code is in an intermediate state. Extend this for the precompiled preamble as well. rdar://14109828 llvm-svn: 183717
* Loosen r178109 even further, to assume that all redefined macros in system ↵Douglas Gregor2013-06-071-7/+10
| | | | | | | | headers and system modules are equivalent. Fixes <rdar://problem/14025673>. llvm-svn: 183588
* Model temporary lifetime-extension explicitly in the AST. Use this model toRichard Smith2013-06-052-0/+2
| | | | | | | | | handle temporaries which have been lifetime-extended to static storage duration within constant expressions. This correctly handles nested lifetime extension (through reference members of aggregates in aggregate initializers) but non-constant-expression emission hasn't yet been updated to do the same. llvm-svn: 183283
* [PCH] Fix crash with valid code, related to anonymous field initializers.Argyrios Kyrtzidis2013-05-301-3/+10
| | | | | | | | | In a certain code-path we were not deserializing an anonymous field initializer correctly, leading to a crash when trying to IRGen it. This is a simpler version of a patch by Yunzhong Gao! llvm-svn: 182974
OpenPOWER on IntegriCloud