aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/DeclTemplate.cpp')
-rw-r--r--lib/AST/DeclTemplate.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index a75c1c0d58..f308d71d5f 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -119,6 +119,16 @@ void FunctionTemplateDecl::Destroy(ASTContext &C) {
Decl::Destroy(C);
}
+FunctionDecl *
+FunctionTemplateDecl::findSpecialization(const TemplateArgument *Args,
+ unsigned NumArgs, void *&InsertPos) {
+ llvm::FoldingSetNodeID ID;
+ FunctionTemplateSpecializationInfo::Profile(ID,Args,NumArgs, getASTContext());
+ FunctionTemplateSpecializationInfo *Info
+ = getSpecializations().FindNodeOrInsertPos(ID, InsertPos);
+ return Info ? Info->Function->getMostRecentDeclaration() : 0;
+}
+
FunctionTemplateDecl *FunctionTemplateDecl::getCanonicalDecl() {
FunctionTemplateDecl *FunTmpl = this;
while (FunTmpl->getPreviousDeclaration())