Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76274 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index f680606..046b27c 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -2082,17 +2082,11 @@
VAT->getBracketsRange());
}
-Decl *ASTContext::getCanonicalDecl(Decl *D) {
- if (!D)
- return 0;
- return D->getCanonicalDecl();
-}
-
TemplateName ASTContext::getCanonicalTemplateName(TemplateName Name) {
// If this template name refers to a template, the canonical
// template name merely stores the template itself.
if (TemplateDecl *Template = Name.getAsTemplateDecl())
- return TemplateName(cast<TemplateDecl>(getCanonicalDecl(Template)));
+ return TemplateName(cast<TemplateDecl>(Template->getCanonicalDecl()));
DependentTemplateName *DTN = Name.getAsDependentTemplateName();
assert(DTN && "Non-dependent template names must refer to template decls.");
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index e096e41..ce382db 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -200,7 +200,7 @@
TemplateTemplateParmDecl *TTP = cast<TemplateTemplateParmDecl>(*Param);
TemplateArgs.push_back(TemplateArgument(TTP->getLocation(), TTP));
CanonTemplateArgs.push_back(TemplateArgument(TTP->getLocation(),
- Context.getCanonicalDecl(TTP)));
+ TTP->getCanonicalDecl()));
}
}