From: Douglas Gregor Date: Wed, 2 Mar 2011 18:57:38 +0000 (+0000) Subject: Kill off the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=044526fe99692343b7770895bdd73f394cc815e4;p=clang Kill off the TreeTransform::TransformDependentTemplateSpecializationType() with poor source-location information handling. All of the CXXScopeSpec::MakeTrivial() and NestedNameSpecifierLocBuilder::MakeTrivial() callers actually make sense now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126856 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 89fde1f579..b7904cd563 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -500,11 +500,6 @@ public: DependentTemplateSpecializationTypeLoc TL, TemplateName Template); - QualType - TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB, - DependentTemplateSpecializationTypeLoc TL, - NestedNameSpecifier *Prefix); - QualType TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL, @@ -4451,66 +4446,6 @@ QualType TreeTransform:: .TransformDependentTemplateSpecializationType(TLB, TL, QualifierLoc); } -template -QualType TreeTransform:: - TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB, - DependentTemplateSpecializationTypeLoc TL, - NestedNameSpecifier *NNS) { - // FIXME: This routine needs to go away. - const DependentTemplateSpecializationType *T = TL.getTypePtr(); - - TemplateArgumentListInfo NewTemplateArgs; - NewTemplateArgs.setLAngleLoc(TL.getLAngleLoc()); - NewTemplateArgs.setRAngleLoc(TL.getRAngleLoc()); - - // FIXME: Nested-name-specifier source location info! - typedef TemplateArgumentLocContainerIterator< - DependentTemplateSpecializationTypeLoc> ArgIterator; - if (getDerived().TransformTemplateArguments(ArgIterator(TL, 0), - ArgIterator(TL, TL.getNumArgs()), - NewTemplateArgs)) - return QualType(); - - CXXScopeSpec SS; - SS.MakeTrivial(SemaRef.Context, NNS, - TL.getQualifierLoc().getSourceRange()); - QualType Result - = getDerived().RebuildDependentTemplateSpecializationType(T->getKeyword(), - SS.getWithLocInContext(SemaRef.Context), - T->getIdentifier(), - TL.getNameLoc(), - NewTemplateArgs); - if (Result.isNull()) - return QualType(); - - if (const ElaboratedType *ElabT = dyn_cast(Result)) { - QualType NamedT = ElabT->getNamedType(); - - // Copy information relevant to the template specialization. - TemplateSpecializationTypeLoc NamedTL - = TLB.push(NamedT); - NamedTL.setLAngleLoc(TL.getLAngleLoc()); - NamedTL.setRAngleLoc(TL.getRAngleLoc()); - for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) - NamedTL.setArgLocInfo(I, TL.getArgLocInfo(I)); - - // Copy information relevant to the elaborated type. - ElaboratedTypeLoc NewTL = TLB.push(Result); - NewTL.setKeywordLoc(TL.getKeywordLoc()); - - // FIXME: DependentTemplateSpecializationType needs better source-location - // info. - NestedNameSpecifierLocBuilder Builder; - Builder.MakeTrivial(SemaRef.Context, - NNS, TL.getQualifierLoc().getSourceRange()); - NewTL.setQualifierLoc(Builder.getWithLocInContext(SemaRef.Context)); - } else { - TypeLoc NewTL(Result, TL.getOpaqueData()); - TLB.pushFullCopy(NewTL); - } - return Result; -} - template QualType TreeTransform:: TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB,