diff options
| author | John McCall <rjmccall@apple.com> | 2009-10-21 00:58:09 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2009-10-21 00:58:09 +0000 |
| commit | 609459e07047a7ba6b7f3b2720fd9bce75fd045a (patch) | |
| tree | b2ffa1386f573fe1293bd0372088832c734535dd /clang/lib | |
| parent | 42e86ab6c40ec77b53eadb9547ff6ee066bbde67 (diff) | |
| download | bcm5719-llvm-609459e07047a7ba6b7f3b2720fd9bce75fd045a.tar.gz bcm5719-llvm-609459e07047a7ba6b7f3b2720fd9bce75fd045a.zip | |
Clone Sema::SubstType for DeclaratorInfos.
llvm-svn: 84724
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/Sema.h | 4 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 4ad3deaadfd..0b55ecd7705 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -3152,6 +3152,10 @@ public: void PerformPendingImplicitInstantiations(); + DeclaratorInfo *SubstType(DeclaratorInfo *T, + const MultiLevelTemplateArgumentList &TemplateArgs, + SourceLocation Loc, DeclarationName Entity); + QualType SubstType(QualType T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity); diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 9b9fc00848b..53d158088c8 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -702,6 +702,22 @@ TemplateInstantiator::TransformTemplateTypeParmType(TypeLocBuilder &TLB, /// /// \returns If the instantiation succeeds, the instantiated /// type. Otherwise, produces diagnostics and returns a NULL type. +DeclaratorInfo *Sema::SubstType(DeclaratorInfo *T, + const MultiLevelTemplateArgumentList &Args, + SourceLocation Loc, + DeclarationName Entity) { + assert(!ActiveTemplateInstantiations.empty() && + "Cannot perform an instantiation without some context on the " + "instantiation stack"); + + if (!T->getType()->isDependentType()) + return T; + + TemplateInstantiator Instantiator(*this, Args, Loc, Entity); + return Instantiator.TransformType(T); +} + +/// Deprecated form of the above. QualType Sema::SubstType(QualType T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity) { |

