diff options
author | John McCall <rjmccall@apple.com> | 2010-04-27 00:57:59 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-27 00:57:59 +0000 |
commit | 31f17ecbef57b5679c017c375db330546b7b5145 (patch) | |
tree | 284e3662375c4f1d59e72b2390c99e2b0e682eb1 /lib/Frontend/PCHWriter.cpp | |
parent | 184d7900e0202ac468710b731e42075129bb6000 (diff) |
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
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 633532fdab..e56dd31322 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -63,6 +63,7 @@ namespace { #define ABSTRACT_TYPE(Class, Base) #define DEPENDENT_TYPE(Class, Base) #include "clang/AST/TypeNodes.def" + void VisitInjectedClassNameType(const InjectedClassNameType *T); }; } @@ -240,7 +241,7 @@ void PCHTypeWriter::VisitQualifiedNameType(const QualifiedNameType *T) { void PCHTypeWriter::VisitInjectedClassNameType(const InjectedClassNameType *T) { Writer.AddDeclRef(T->getDecl(), Record); - Writer.AddTypeRef(T->getUnderlyingType(), Record); + Writer.AddTypeRef(T->getInjectedSpecializationType(), Record); Code = pch::TYPE_INJECTED_CLASS_NAME; } |