| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
we were going to enter into the scope of a class template or class
template partial specialization, rebuild that type so that it can
refer to members of the current instantiation, as in code like
template<typename T>
struct X {
typedef T* pointer;
pointer data();
};
template<typename T>
typename X<T>::pointer X<T>::data() { ... }
Without rebuilding the return type of this out-of-line definition, the
canonical return type of the out-of-line definition (a TypenameType)
will not match the canonical return type of the declaration (the
canonical type of T*).
llvm-svn: 78316
|
|
|
|
| |
llvm-svn: 78102
|
|
|
|
|
|
|
|
|
| |
transformation template (TreeTransform) that handles the
transformation and reconstruction of AST nodes. Template instantiation
for types is a (relatively small) customization of the generic tree
transformation.
llvm-svn: 78071
|
|
|
|
|
|
| |
and a name collision.
llvm-svn: 77658
|
|
|
|
|
|
| |
linkage specifications correctly.
llvm-svn: 77653
|
|
|
|
|
|
| |
partial specializations.
llvm-svn: 77606
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()
And remove Type::getAsReferenceType(), etc.
This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.
llvm-svn: 77510
|
|
|
|
|
|
|
|
|
| |
A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.
llvm-svn: 77488
|
|
|
|
|
|
|
|
| |
functions, only return those overloaded functions that are actually
function templates. Note that there is still a glaring problem with
treating an OverloadedFunctionDecl as a TemplateName.
llvm-svn: 77472
|
|
|
|
|
|
| |
of function templates
llvm-svn: 77464
|
|
|
|
|
|
|
|
| |
template arguments, as in template specialization types. This permits
matching out-of-line definitions of members for class templates that
involve non-type template parameters.
llvm-svn: 77462
|
|
|
|
|
|
|
|
| |
canonicalization for dependent TemplateSpecializationTypes occurs
within ASTContext::getTemplateSpecializationType. Also, move template
argument canonicalization into ASTContext::getCanonicalTemplateArgument.
llvm-svn: 77388
|
|
|
|
|
|
|
|
|
| |
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.
Removed the ActOnClassTemplate action, which is no longer used.
llvm-svn: 76881
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates, e.g.,
template<typename T>
struct Outer {
struct Inner;
};
template<typename T>
struct Outer<T>::Inner {
// ...
};
Implementing this feature required some extensions to ActOnTag, which
now takes a set of template parameter lists, and is the precursor to
removing the ActOnClassTemplate function from the parser Action
interface. The reason for this approach is simple: the parser cannot
tell the difference between a class template definition and the
definition of a member of a class template; both have template
parameter lists, and semantic analysis determines what that template
parameter list means.
There is still some cleanup to do with ActOnTag and
ActOnClassTemplate. This commit provides the basic functionality we
need, however.
llvm-svn: 76820
|
|
|
|
| |
llvm-svn: 76783
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
member functions of class templates, e.g.,
template<typename T>
struct X {
void f(T);
};
template<typename T> X<T>::f(T) { /* ... */ }
llvm-svn: 76692
|
|
|
|
|
|
| |
Zaffanella, with tweaks from Abramo Bagnara.
llvm-svn: 76576
|
|
|
|
|
|
| |
place.
llvm-svn: 76274
|
|
|
|
|
|
|
|
|
| |
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.
llvm-svn: 76193
|
|
|
|
|
|
| |
Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.
llvm-svn: 76139
|
|
|
|
| |
llvm-svn: 76132
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.
The motivation behind this change is twofold:
1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.
2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.
Along with this patch:
a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.
llvm-svn: 76098
|
|
|
|
|
|
|
| |
are fewer template arguments than there are template parameters for
that function.
llvm-svn: 74578
|
|
|
|
|
|
|
| |
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.
llvm-svn: 74563
|
|
|
|
|
|
|
| |
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.
llvm-svn: 74506
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates.
For example, this now type-checks (but does not instantiate the body
of deref<int>):
template<typename T> T& deref(T* t) { return *t; }
void test(int *ip) {
int &ir = deref(ip);
}
Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.
llvm-svn: 74213
|
|
|
|
|
|
| |
function templates. C++ [temp.over.link] paragraphs 4-8.
llvm-svn: 74079
|
|
|
|
|
|
| |
ActOnFunctionDeclarator for function template definitions
llvm-svn: 74040
|
|
|
|
|
|
| |
and associate it with the FunctionDecl.
llvm-svn: 74028
|
|
|
|
|
|
|
| |
handle function templates. There's no actual code for function
templates yet, but at least we complain about typedef templates.
llvm-svn: 74021
|
|
|
|
|
|
| |
variadic templates.
llvm-svn: 73937
|
|
|
|
|
|
|
|
|
|
| |
<rdar://problem/6952203>.
To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.
llvm-svn: 73659
|
|
|
|
|
|
| |
thereof. Patch by Anders Johnsen!
llvm-svn: 73641
|
|
|
|
| |
llvm-svn: 73395
|
|
|
|
| |
llvm-svn: 73391
|
|
|
|
|
|
| |
TemplateArgumentListBuilder. No functionality change.
llvm-svn: 73297
|
|
|
|
| |
llvm-svn: 73281
|
|
|
|
|
|
| |
functionality change.
llvm-svn: 73275
|
|
|
|
|
|
|
| |
specialization cannot be deduced, produce a warning noting that the
affected class template partial specialization will never be used.
llvm-svn: 73274
|
|
|
|
| |
llvm-svn: 73269
|
|
|
|
| |
llvm-svn: 73268
|
|
|
|
| |
llvm-svn: 73262
|
|
|
|
| |
llvm-svn: 73261
|
|
|
|
| |
llvm-svn: 73260
|
|
|
|
|
|
|
|
|
| |
specialization's arguments are identical to the implicit template
arguments of the primary template. Typically, this is meant to be a
declaration/definition of the primary template, so we give that
advice.
llvm-svn: 73259
|
|
|
|
|
|
| |
template partial specializations.
llvm-svn: 73254
|
|
|
|
| |
llvm-svn: 73247
|
|
|
|
|
|
|
| |
specialization do not have default arguments
(C++ [temp.class.spec]p10).
llvm-svn: 73245
|
|
|
|
|
|
|
|
|
|
|
|
| |
partial specialization, substitute those template arguments back into
the template arguments of the class template partial specialization to
see if the results still match the original template arguments.
This code is more general than it needs to be, since we don't yet
diagnose C++ [temp.class.spec]p9. However, it's likely to be needed
for function templates.
llvm-svn: 73196
|
|
|
|
|
|
| |
instantiate non-type template arguments.
llvm-svn: 73193
|