forked from OSchip/llvm-project
Introduce RedeclarableTemplateDecl::SpecEntryTraits
SpecEntryTraits describes how to obtain the most recent declaration of a specialisation from an entry in a specialisation FoldingSet. llvm-svn: 109868
This commit is contained in:
parent
3df5a08b99
commit
e3de2ebe75
|
@ -504,6 +504,14 @@ class RedeclarableTemplateDecl : public TemplateDecl {
|
|||
}
|
||||
|
||||
protected:
|
||||
template <typename EntryType> struct SpecEntryTraits {
|
||||
typedef EntryType DeclType;
|
||||
|
||||
static DeclType *getMostRecentDeclaration(EntryType *D) {
|
||||
return D->getMostRecentDeclaration();
|
||||
}
|
||||
};
|
||||
|
||||
struct CommonBase {
|
||||
CommonBase() : InstantiatedFromMember(0, false) { }
|
||||
|
||||
|
@ -677,6 +685,16 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
template <> struct RedeclarableTemplateDecl::
|
||||
SpecEntryTraits<FunctionTemplateSpecializationInfo> {
|
||||
typedef FunctionDecl DeclType;
|
||||
|
||||
static DeclType *
|
||||
getMostRecentDeclaration(FunctionTemplateSpecializationInfo *I) {
|
||||
return I->Function->getMostRecentDeclaration();
|
||||
}
|
||||
};
|
||||
|
||||
/// Declaration of a template function.
|
||||
class FunctionTemplateDecl : public RedeclarableTemplateDecl,
|
||||
public RedeclarableTemplate<FunctionTemplateDecl> {
|
||||
|
|
Loading…
Reference in New Issue