summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ODRHash.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2018-05-30 01:12:26 +0000
committerRichard Trieu <rtrieu@google.com>2018-05-30 01:12:26 +0000
commit9359e8f22a5403ad9524a92c4ccab4db46c9c100 (patch)
treedbec4e5b28098a20b175bd74f7ee0d1f96651bff /clang/lib/AST/ODRHash.cpp
parent92e523bf5508737c29b0598b11ee1d6b443bfc29 (diff)
downloadbcm5719-llvm-9359e8f22a5403ad9524a92c4ccab4db46c9c100.tar.gz
bcm5719-llvm-9359e8f22a5403ad9524a92c4ccab4db46c9c100.zip
[ODRHash] Support FunctionTemplateDecl in records.
llvm-svn: 333486
Diffstat (limited to 'clang/lib/AST/ODRHash.cpp')
-rw-r--r--clang/lib/AST/ODRHash.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp
index ee6950655cf..7a3a6964e5b 100644
--- a/clang/lib/AST/ODRHash.cpp
+++ b/clang/lib/AST/ODRHash.cpp
@@ -383,6 +383,7 @@ public:
if (hasDefaultArgument) {
AddTemplateArgument(D->getDefaultArgument());
}
+ Hash.AddBoolean(D->isParameterPack());
Inherited::VisitTemplateTypeParmDecl(D);
}
@@ -395,6 +396,7 @@ public:
if (hasDefaultArgument) {
AddStmt(D->getDefaultArgument());
}
+ Hash.AddBoolean(D->isParameterPack());
Inherited::VisitNonTypeTemplateParmDecl(D);
}
@@ -407,9 +409,27 @@ public:
if (hasDefaultArgument) {
AddTemplateArgument(D->getDefaultArgument().getArgument());
}
+ Hash.AddBoolean(D->isParameterPack());
Inherited::VisitTemplateTemplateParmDecl(D);
}
+
+ void VisitTemplateDecl(const TemplateDecl *D) {
+ Hash.AddTemplateParameterList(D->getTemplateParameters());
+
+ Inherited::VisitTemplateDecl(D);
+ }
+
+ void VisitRedeclarableTemplateDecl(const RedeclarableTemplateDecl *D) {
+ Hash.AddBoolean(D->isMemberSpecialization());
+ Inherited::VisitRedeclarableTemplateDecl(D);
+ }
+
+ void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
+ Visit(D->getTemplatedDecl());
+ ID.AddInteger(D->getTemplatedDecl()->getODRHash());
+ Inherited::VisitFunctionTemplateDecl(D);
+ }
};
} // namespace
@@ -428,6 +448,7 @@ bool ODRHash::isWhitelistedDecl(const Decl *D, const CXXRecordDecl *Parent) {
case Decl::CXXMethod:
case Decl::Field:
case Decl::Friend:
+ case Decl::FunctionTemplate:
case Decl::StaticAssert:
case Decl::TypeAlias:
case Decl::Typedef:
OpenPOWER on IntegriCloud