diff options
author | Bruno Ricci <riccibrun@gmail.com> | 2018-12-21 14:35:24 +0000 |
---|---|---|
committer | Bruno Ricci <riccibrun@gmail.com> | 2018-12-21 14:35:24 +0000 |
commit | 4224c8764c42bdaf95f988dfebe16c90613762b8 (patch) | |
tree | a071bfaeae8795c4bc1f5776c2688b8b39cde00d /clang/lib/Sema/SemaTemplate.cpp | |
parent | af1ab22a768f97d9cb585886e157f2c948819f4d (diff) | |
download | bcm5719-llvm-4224c8764c42bdaf95f988dfebe16c90613762b8.tar.gz bcm5719-llvm-4224c8764c42bdaf95f988dfebe16c90613762b8.zip |
[Sema][NFC] Remove some unnecessary calls to getASTContext.
The AST context is already easily available. NFC.
llvm-svn: 349904
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index e0f4d2e4950..2d2d08f23e2 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1255,9 +1255,10 @@ Sema::ActOnTemplateParameterList(unsigned Depth, RAngleLoc, RequiresClause); } -static void SetNestedNameSpecifier(TagDecl *T, const CXXScopeSpec &SS) { +static void SetNestedNameSpecifier(Sema &S, TagDecl *T, + const CXXScopeSpec &SS) { if (SS.isSet()) - T->setQualifierInfo(SS.getWithLocInContext(T->getASTContext())); + T->setQualifierInfo(SS.getWithLocInContext(S.Context)); } DeclResult Sema::CheckClassTemplate( @@ -1554,7 +1555,7 @@ DeclResult Sema::CheckClassTemplate( PrevClassTemplate && ShouldAddRedecl ? PrevClassTemplate->getTemplatedDecl() : nullptr, /*DelayTypeCreation=*/true); - SetNestedNameSpecifier(NewClass, SS); + SetNestedNameSpecifier(*this, NewClass, SS); if (NumOuterTemplateParamLists > 0) NewClass->setTemplateParameterListsInfo( Context, llvm::makeArrayRef(OuterTemplateParamLists, @@ -7650,7 +7651,7 @@ DeclResult Sema::ActOnClassTemplateSpecialization( TemplateArgs, CanonType, PrevPartial); - SetNestedNameSpecifier(Partial, SS); + SetNestedNameSpecifier(*this, Partial, SS); if (TemplateParameterLists.size() > 1 && SS.isSet()) { Partial->setTemplateParameterListsInfo( Context, TemplateParameterLists.drop_back(1)); @@ -7676,7 +7677,7 @@ DeclResult Sema::ActOnClassTemplateSpecialization( ClassTemplate, Converted, PrevDecl); - SetNestedNameSpecifier(Specialization, SS); + SetNestedNameSpecifier(*this, Specialization, SS); if (TemplateParameterLists.size() > 0) { Specialization->setTemplateParameterListsInfo(Context, TemplateParameterLists); @@ -8775,7 +8776,7 @@ DeclResult Sema::ActOnExplicitInstantiation( ClassTemplate, Converted, PrevDecl); - SetNestedNameSpecifier(Specialization, SS); + SetNestedNameSpecifier(*this, Specialization, SS); if (!HasNoEffect && !PrevDecl) { // Insert the new specialization. |