]> granicus.if.org Git - clang/commit
Make the InjectedClassNameType the canonical type of the current instantiation
authorJohn McCall <rjmccall@apple.com>
Tue, 27 Apr 2010 00:57:59 +0000 (00:57 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 27 Apr 2010 00:57:59 +0000 (00:57 +0000)
commit31f17ecbef57b5679c017c375db330546b7b5145
tree284e3662375c4f1d59e72b2390c99e2b0e682eb1
parent184d7900e0202ac468710b731e42075129bb6000
Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization.  That is to
say, in
  template <class T> class A { ... };
or
  template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context.  This allows us to track the
current instantiation appropriately even inside AST routines.  It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/DeclTemplate.h
include/clang/AST/Type.h
include/clang/AST/TypeNodes.def
lib/AST/ASTContext.cpp
lib/AST/ASTDiagnostic.cpp
lib/AST/ASTImporter.cpp
lib/AST/DeclCXX.cpp
lib/AST/DeclTemplate.cpp
lib/AST/Type.cpp
lib/AST/TypePrinter.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/Mangle.cpp
lib/Frontend/PCHWriter.cpp
lib/Sema/Sema.h
lib/Sema/SemaCXXScopeSpec.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateDeduction.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/SemaTemplate/instantiate-member-expr.cpp