From 2408e32096b3219cce1dc58c7b38d299b267b9e8 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 27 Apr 2010 00:57:59 +0000 Subject: 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 A { ... }; or template class B { ... }; make 'A' and 'B' 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). llvm-svn: 102407 --- clang/lib/AST/DeclCXX.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'clang/lib/AST/DeclCXX.cpp') diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index eef067b0d89..e6e9ee6cc0a 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -659,15 +659,6 @@ QualType CXXMethodDecl::getThisType(ASTContext &C) const { assert(isInstance() && "No 'this' for static methods!"); QualType ClassTy = C.getTypeDeclType(getParent()); - - // Aesthetically we prefer not to synthesize a type as the - // InjectedClassNameType of a template pattern: injected class names - // are printed without template arguments, which might - // surprise/confuse/distract our poor users if they didn't - // explicitly write one. - if (isa(ClassTy)) - ClassTy = cast(ClassTy)->getUnderlyingType(); - ClassTy = C.getQualifiedType(ClassTy, Qualifiers::fromCVRMask(getTypeQualifiers())); return C.getPointerType(ClassTy); -- cgit v1.2.3