diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-08-11 22:01:17 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-08-11 22:01:17 +0000 |
commit | d6d2f189054335fcfc22e9a496b541fd77d09a0b (patch) | |
tree | 3a775745cb19fb64a92faba7b057f20e43e862c1 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 00c37ef0216518f404953eb90f8cf70c5a8644f9 (diff) | |
download | bcm5719-llvm-d6d2f189054335fcfc22e9a496b541fd77d09a0b.tar.gz bcm5719-llvm-d6d2f189054335fcfc22e9a496b541fd77d09a0b.zip |
Added locations and type source info for DeclarationName.
llvm-svn: 110860
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 8e184f15144..fe21ace6865 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1294,39 +1294,27 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D, CXXRecordDecl *Record = cast<CXXRecordDecl>(DC); CXXMethodDecl *Method = 0; - DeclarationName Name = D->getDeclName(); + DeclarationNameInfo NameInfo + = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs); if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(D)) { - QualType ClassTy = SemaRef.Context.getTypeDeclType(Record); - Name = SemaRef.Context.DeclarationNames.getCXXConstructorName( - SemaRef.Context.getCanonicalType(ClassTy)); Method = CXXConstructorDecl::Create(SemaRef.Context, Record, - Constructor->getLocation(), - Name, T, TInfo, + NameInfo, T, TInfo, Constructor->isExplicit(), Constructor->isInlineSpecified(), false); } else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(D)) { - QualType ClassTy = SemaRef.Context.getTypeDeclType(Record); - Name = SemaRef.Context.DeclarationNames.getCXXDestructorName( - SemaRef.Context.getCanonicalType(ClassTy)); Method = CXXDestructorDecl::Create(SemaRef.Context, Record, - Destructor->getLocation(), Name, - T, Destructor->isInlineSpecified(), + NameInfo, T, + Destructor->isInlineSpecified(), false); } else if (CXXConversionDecl *Conversion = dyn_cast<CXXConversionDecl>(D)) { - CanQualType ConvTy - = SemaRef.Context.getCanonicalType( - T->getAs<FunctionType>()->getResultType()); - Name = SemaRef.Context.DeclarationNames.getCXXConversionFunctionName( - ConvTy); Method = CXXConversionDecl::Create(SemaRef.Context, Record, - Conversion->getLocation(), Name, - T, TInfo, + NameInfo, T, TInfo, Conversion->isInlineSpecified(), Conversion->isExplicit()); } else { - Method = CXXMethodDecl::Create(SemaRef.Context, Record, D->getLocation(), - D->getDeclName(), T, TInfo, + Method = CXXMethodDecl::Create(SemaRef.Context, Record, + NameInfo, T, TInfo, D->isStatic(), D->getStorageClassAsWritten(), D->isInlineSpecified()); @@ -1390,8 +1378,8 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D, if (InitMethodInstantiation(Method, D)) Method->setInvalidDecl(); - LookupResult Previous(SemaRef, Name, SourceLocation(), - Sema::LookupOrdinaryName, Sema::ForRedeclaration); + LookupResult Previous(SemaRef, NameInfo, Sema::LookupOrdinaryName, + Sema::ForRedeclaration); if (!FunctionTemplate || TemplateParams || isFriend) { SemaRef.LookupQualifiedName(Previous, Record); |