diff options
author | Richard Trieu <rtrieu@google.com> | 2018-05-30 01:12:26 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-05-30 01:12:26 +0000 |
commit | 9359e8f22a5403ad9524a92c4ccab4db46c9c100 (patch) | |
tree | dbec4e5b28098a20b175bd74f7ee0d1f96651bff /clang/lib/AST/ODRHash.cpp | |
parent | 92e523bf5508737c29b0598b11ee1d6b443bfc29 (diff) | |
download | bcm5719-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.cpp | 21 |
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: |