summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* A clean-up pass, exploring the unification of traversals of class, variable ↵Larisse Voufo2013-08-231-2/+2
| | | | | | and function templates. llvm-svn: 189152
* Comment parsing: fix a bug where a line with whitespace between two paragraphsDmitri Gribenko2013-08-231-0/+21
| | | | | | | | | | would cause us to concatenate these paragraphs into a single one. The no-op whitespace churn in test/Index test happened because these tests don't use the correct approach for testing and are more strict than required for they are testing. llvm-svn: 189126
* Fix indentationDmitri Gribenko2013-08-231-1/+1
| | | | llvm-svn: 189119
* Use CharInfo.h routines in TextComment::isWhitespaceNoCacheDmitri Gribenko2013-08-231-3/+2
| | | | llvm-svn: 189115
* Use pop_back_val() instead of both back() and pop_back().Robert Wilhelm2013-08-233-7/+5
| | | | | | No functionality change intended. llvm-svn: 189112
* Remove SequenceNumber from class/variable template partial specializations.Richard Smith2013-08-221-21/+14
| | | | | | | | 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-225-69/+15
| | | | | | This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7. llvm-svn: 189004
* Constify more uses of ASTContext&. No functional change.Craig Topper2013-08-223-58/+62
| | | | llvm-svn: 188991
* Constify some more ASTContext& uses.Craig Topper2013-08-222-14/+15
| | | | llvm-svn: 188989
* Constify the ASTContext& passed to Stmt creation functions. Also constify ↵Craig Topper2013-08-221-43/+38
| | | | | | the context in couple other functions that are called from creation functions. llvm-svn: 188986
* Constify the ASTContext& passed to Expr creation functions. Also constify ↵Craig Topper2013-08-222-19/+19
| | | | | | the context in couple other functions that are called from creation functions. llvm-svn: 188985
* Implement a rudimentary form of generic lambdas.Faisal Vali2013-08-225-15/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reduce sizeof(TemplateArgument) from 32 to 24.Eli Friedman2013-08-211-6/+10
| | | | | | No intended functionality change. llvm-svn: 188959
* Sema: Use the right type for PredefinedExpr when it's in a lambda.Benjamin Kramer2013-08-211-1/+12
| | | | | | | | | | | | | 1. We now print the return type of lambdas and return type deduced functions as "auto". Trailing return types with decltype print the underlying type. 2. Use the lambda or block scope for the PredefinedExpr type instead of the parent function. This fixes PR16946, a strange mismatch between type of the expression and the actual result. 3. Verify the type in CodeGen. 4. The type for blocks is still wrong. They are numbered and the name is not known until CodeGen. llvm-svn: 188900
* Abstract out virtual calls and virtual function prologue code generation; ↵Timur Iskhodzhanov2013-08-211-6/+13
| | | | | | implement them for -cxx-abi microsoft llvm-svn: 188870
* Revert accidental commit.Craig Topper2013-08-211-56/+59
| | | | llvm-svn: 188862
* Replace avx-512 with avx512f to match llvm side and what gcc patches appear ↵Craig Topper2013-08-211-59/+56
| | | | | | to be using. llvm-svn: 188860
* Revert r188756 because some other changes snuck in with it.Craig Topper2013-08-201-56/+59
| | | | llvm-svn: 188757
* Add AVX-512 feature flag and knl cpu to clang.Craig Topper2013-08-201-59/+56
| | | | llvm-svn: 188756
* Fix name lookup with dependent using decls.Eli Friedman2013-08-201-0/+9
| | | | | | | | | | We previously mishandled UnresolvedUsingValueDecls in NamedDecl::declarationReplaces, which caused us to forget decls when there are multiple dependent using decls for the same name. Fixes PR16936. llvm-svn: 188737
* Make the version of Stmt::operator new that takes ASTContext* call the ↵Craig Topper2013-08-191-5/+0
| | | | | | ASTContext& version in Stmt inline instead of having two out of line functions that both call to the global versions. llvm-svn: 188648
* Revert r188644 to unbreak buildbots.Craig Topper2013-08-181-0/+5
| | | | llvm-svn: 188645
* Remove Stmt::operator new that takes a ASTContext*. All callers use the ↵Craig Topper2013-08-181-5/+0
| | | | | | ASTContext& version. llvm-svn: 188644
* Remove throw() from Stmt::operator new so the compiler will omit the null ↵Craig Topper2013-08-181-2/+2
| | | | | | check on the result since ASTContext allocator won't return null. llvm-svn: 188641
* Make expression allocation methods use a 'const' reference to the ASTContext ↵Craig Topper2013-08-182-44/+48
| | | | | | since the underlying operator new only needs a const reference. llvm-svn: 188636
* Parse: Do not 'HandleTopLevelDecl' on templated functions.David Majnemer2013-08-161-7/+3
| | | | | | | | | | | | | | | | Summary: HandleTopLevelDecl on a templated function leads us to try and mangle it. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1412 llvm-svn: 188536
* Properly track l-paren of a CXXFucntionalCastExpr.Eli Friedman2013-08-152-5/+13
| | | | | | | | | | 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
* [Mips][msa] Add support for halfJack Carter2013-08-151-0/+5
| | | | | | | | | Add support for half (a.k.a. __fp16) in builtin descriptions. The second argument to BUILTIN() now accepts 'h' to represent half. Patch by Daniel Sanders llvm-svn: 188464
* [-cxx-abi microsoft] Mangle member pointers betterDavid Majnemer2013-08-151-14/+24
| | | | | | | | | | | | | | | | | | | | Summary: There were several things going wrong: - We mangled in useless qualifiers like "volatile void" return types. - We didn't propagate 64-bit pointer markers sufficiently. - We mangled qualifiers belonging to the pointee incorrectly. This fixes PR16844 and PR16848. Reviewers: rnk, whunt Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1353 llvm-svn: 188450
* Fix typo in comment.David Majnemer2013-08-131-1/+1
| | | | | | Thanks Kim Gräsman! llvm-svn: 188257
* [-cxx-abi microsoft] Mangle __uuidof correctly into template parametersDavid Majnemer2013-08-132-0/+43
| | | | | | | | | | | | | | | | | | | | | | | Summary: It seems that __uuidof introduces a global extern "C" declaration of type __s_GUID. However, our implementation of __uuidof does not provide such a declaration and thus must open-code the mangling for __uuidof in template parameters. This allows us to codegen scoped COM pointers and other such things. This fixes PR16836. Depends on D1356. Reviewers: rnk, cdavis5x, rsmith Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1357 llvm-svn: 188252
* variable templates updated for PCH serialization... Still working on test ↵Larisse Voufo2013-08-131-0/+10
| | | | | | cases... llvm-svn: 188249
* [-cxx-abi microsoft] Mangle TemplateArgument::Declaration for referencesDavid Majnemer2013-08-131-2/+4
| | | | | | | | | | | | | | | | Summary: Properly mangle declarations showing up in template arguments that are reference parameters. Fun-fact: undname cannot handle these! Reviewers: rnk, cdavis5x Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1356 llvm-svn: 188245
* Fix pretty-printing for unnamed unions.Eli Friedman2013-08-122-0/+4
| | | | | | | This is just a couple of minor fixes to account for the existence of ElaboratedType. llvm-svn: 188209
* Added source locs for angled parentheses in class/var template partial specs.Enea Zaffanella2013-08-101-19/+11
| | | | llvm-svn: 188134
* Correctly profile CXXPseudoDestructorExprs.Eli Friedman2013-08-091-1/+8
| | | | | | CXXPseudoDestructorExprs may not contain a type. PR16852. llvm-svn: 188123
* Expose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.James Dennett2013-08-091-6/+10
| | | | | | | | | | | | | | | | | | | | | 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
* Revert "[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the ↵David Majnemer2013-08-091-1/+4
| | | | | | | | | | proper section" This commit reverts r188053. It is breaking the build bots. llvm-svn: 188055
* [-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper sectionDavid Majnemer2013-08-091-4/+1
| | | | | | | | | | | | We mangled them like: L___uuid_12345678-1234-1234-1234-123456789abc We should've mangled them like: __GUID_12345678_1234_1234_1234_123456789abc Furthermore, they are external symbols. llvm-svn: 188053
* Implement [class.friend]p11's special name lookup rules for friend declarationsRichard Smith2013-08-091-8/+1
| | | | | | | | of local classes. We were previously handling this by performing qualified lookup within a function declaration(!!); replace it with the proper scope lookup. llvm-svn: 188050
* Fix alignof computation of large arrays on x86_64.Rafael Espindola2013-08-081-9/+4
| | | | | | | | | | | We were exposing the extra alignment given to large arrays. The new behavior matches gcc, which is a good thing since this is a gcc extension. Thanks to Joerg Sonnenberger for noticing it. While at it, centralize the method description in the .h file. llvm-svn: 187999
* Correctly allign arrays on 32 bit systems.Rafael Espindola2013-08-071-7/+8
| | | | | | | | | | | Before this patch we would align long long int big[1024]; to 4 bytes on 32 bit systems. The problem is that we were only looking at the element type when getLargeArrayMinWidth returned non zero. llvm-svn: 187897
* Patch to fix doxygen trailing comments for ObjectiveC methods.Fariborz Jahanian2013-08-071-1/+1
| | | | | | // rdar://14258334 llvm-svn: 187893
* Patch to fix doxygen trailing comments for ObjectiveC properties.Fariborz Jahanian2013-08-061-1/+2
| | | | | | // rdar://14258334 llvm-svn: 187835
* PR16755: When initializing or modifying a bitfield member in a constantRichard Smith2013-08-061-7/+48
| | | | | | expression, truncate the stored value to the size of the bitfield. llvm-svn: 187782
* Started implementing variable templates. Top level declarations should be ↵Larisse Voufo2013-08-066-39/+587
| | | | | | 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
* [ms-cxxabi] Properly mangle member pointersDavid Majnemer2013-08-051-1/+9
| | | | | | | | | | There were three things missing from the original implementation: - We would omit the 'E' qualifier for members int 64-bit mode. - We would not exmaine the qualifiers in 'IsMember' mode. - We didn't generate the correct backref to the base class. llvm-svn: 187753
* [ms-cxxabi] Handle template-template argumentsDavid Majnemer2013-08-051-7/+10
| | | | | | | Template-template arguments appear to be a rather simple encoding of the template's templated tag type. llvm-svn: 187751
* [ms-cxxabi] Mangle nullptr template argumentsDavid Majnemer2013-08-051-2/+4
| | | | | | MSVC mangles nullptr template arguments identically to zero literals. llvm-svn: 187741
* AST: Treat inline function declarations in -fms-compatibility as if it were ↵David Majnemer2013-08-011-2/+3
| | | | | | | | in C++ when in C mode This essentially fixes PR16766. llvm-svn: 187586
OpenPOWER on IntegriCloud