| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
and function templates.
llvm-svn: 189152
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 189119
|
|
|
|
| |
llvm-svn: 189115
|
|
|
|
|
|
| |
No functionality change intended.
llvm-svn: 189112
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.
llvm-svn: 189004
|
|
|
|
| |
llvm-svn: 188991
|
|
|
|
| |
llvm-svn: 188989
|
|
|
|
|
|
| |
the context in couple other functions that are called from creation functions.
llvm-svn: 188986
|
|
|
|
|
|
| |
the context in couple other functions that are called from creation functions.
llvm-svn: 188985
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
No intended functionality change.
llvm-svn: 188959
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
implement them for -cxx-abi microsoft
llvm-svn: 188870
|
|
|
|
| |
llvm-svn: 188862
|
|
|
|
|
|
| |
to be using.
llvm-svn: 188860
|
|
|
|
| |
llvm-svn: 188757
|
|
|
|
| |
llvm-svn: 188756
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
ASTContext& version in Stmt inline instead of having two out of line functions that both call to the global versions.
llvm-svn: 188648
|
|
|
|
| |
llvm-svn: 188645
|
|
|
|
|
|
| |
ASTContext& version.
llvm-svn: 188644
|
|
|
|
|
|
| |
check on the result since ASTContext allocator won't return null.
llvm-svn: 188641
|
|
|
|
|
|
| |
since the underlying operator new only needs a const reference.
llvm-svn: 188636
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Thanks Kim Gräsman!
llvm-svn: 188257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
cases...
llvm-svn: 188249
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This is just a couple of minor fixes to account for the existence
of ElaboratedType.
llvm-svn: 188209
|
|
|
|
| |
llvm-svn: 188134
|
|
|
|
|
|
| |
CXXPseudoDestructorExprs may not contain a type. PR16852.
llvm-svn: 188123
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
proper section"
This commit reverts r188053.
It is breaking the build bots.
llvm-svn: 188055
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
// rdar://14258334
llvm-svn: 187893
|
|
|
|
|
|
| |
// rdar://14258334
llvm-svn: 187835
|
|
|
|
|
|
| |
expression, truncate the stored value to the size of the bitfield.
llvm-svn: 187782
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Template-template arguments appear to be a rather simple encoding of the
template's templated tag type.
llvm-svn: 187751
|
|
|
|
|
|
| |
MSVC mangles nullptr template arguments identically to zero literals.
llvm-svn: 187741
|
|
|
|
|
|
|
|
| |
in C++ when in C mode
This essentially fixes PR16766.
llvm-svn: 187586
|