aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-17 17:10:20 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-17 17:10:20 +0000
commit9e6f2a8d70c3027e99c354edd9d31a37c102f30a (patch)
tree1202dcf40591a9078de89b412177f379d4d0142a /lib/AST/DeclTemplate.cpp
parenta5b9332418f25338f118358e27303cd510d54107 (diff)
Devirtualize RedeclarableTemplateDecl::newCommon().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclTemplate.cpp')
-rw-r--r--lib/AST/DeclTemplate.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index a73deeab3a..2005ff62f6 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -112,6 +112,14 @@ RedeclarableTemplateDecl::CommonBase *RedeclarableTemplateDecl::getCommonPtr() {
}
+RedeclarableTemplateDecl::CommonBase *
+RedeclarableTemplateDecl::newCommon(ASTContext &C) {
+ if (FunctionTemplateDecl *FunTmpl = dyn_cast<FunctionTemplateDecl>(this))
+ return FunTmpl->newCommon(C);
+
+ return cast<ClassTemplateDecl>(this)->newCommon(C);
+}
+
RedeclarableTemplateDecl *RedeclarableTemplateDecl::getCanonicalDeclImpl() {
RedeclarableTemplateDecl *Tmpl = this;
while (Tmpl->getPreviousDeclaration())