forked from OSchip/llvm-project
Devirtualize RedeclarableTemplateDecl::newCommon().
llvm-svn: 125750
This commit is contained in:
parent
c6196aa481
commit
0215459c37
|
@ -561,7 +561,7 @@ protected:
|
||||||
/// for the common pointer.
|
/// for the common pointer.
|
||||||
CommonBase *getCommonPtr();
|
CommonBase *getCommonPtr();
|
||||||
|
|
||||||
virtual CommonBase *newCommon(ASTContext &C) = 0;
|
CommonBase *newCommon(ASTContext &C);
|
||||||
|
|
||||||
// Construct a template decl with name, parameters, and templated element.
|
// Construct a template decl with name, parameters, and templated element.
|
||||||
RedeclarableTemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
|
RedeclarableTemplateDecl(Kind DK, DeclContext *DC, SourceLocation L,
|
||||||
|
@ -773,6 +773,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
friend class FunctionDecl;
|
friend class FunctionDecl;
|
||||||
|
friend class RedeclarableTemplateDecl;
|
||||||
|
|
||||||
/// \brief Retrieve the set of function template specializations of this
|
/// \brief Retrieve the set of function template specializations of this
|
||||||
/// function template.
|
/// function template.
|
||||||
|
@ -1731,6 +1732,8 @@ protected:
|
||||||
return static_cast<Common *>(RedeclarableTemplateDecl::getCommonPtr());
|
return static_cast<Common *>(RedeclarableTemplateDecl::getCommonPtr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
friend class RedeclarableTemplateDecl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Get the underlying class declarations of the template.
|
/// Get the underlying class declarations of the template.
|
||||||
CXXRecordDecl *getTemplatedDecl() const {
|
CXXRecordDecl *getTemplatedDecl() const {
|
||||||
|
|
|
@ -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 *RedeclarableTemplateDecl::getCanonicalDeclImpl() {
|
||||||
RedeclarableTemplateDecl *Tmpl = this;
|
RedeclarableTemplateDecl *Tmpl = this;
|
||||||
while (Tmpl->getPreviousDeclaration())
|
while (Tmpl->getPreviousDeclaration())
|
||||||
|
|
Loading…
Reference in New Issue