diff options
author | Richard Trieu <rtrieu@google.com> | 2017-03-08 00:13:19 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-03-08 00:13:19 +0000 |
commit | 33562c2dcc208ce8dca7a51900a856be9cf70f0b (patch) | |
tree | ac5060fb7e0b4dc782cf99983c5a0b3e1224ed9d /clang/lib/AST/ODRHash.cpp | |
parent | 1351db49b2be3a92909ced637664e08ecd035548 (diff) |
[ODRHash] Hash typedefs and usings statements in classes.
llvm-svn: 297246
Diffstat (limited to 'clang/lib/AST/ODRHash.cpp')
-rw-r--r-- | clang/lib/AST/ODRHash.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp index a0b870f4dacc..d72eebbe8e48 100644 --- a/clang/lib/AST/ODRHash.cpp +++ b/clang/lib/AST/ODRHash.cpp @@ -211,6 +211,20 @@ public: Inherited::VisitCXXMethodDecl(D); } + + void VisitTypedefNameDecl(const TypedefNameDecl *D) { + AddQualType(D->getUnderlyingType()); + + Inherited::VisitTypedefNameDecl(D); + } + + void VisitTypedefDecl(const TypedefDecl *D) { + Inherited::VisitTypedefDecl(D); + } + + void VisitTypeAliasDecl(const TypeAliasDecl *D) { + Inherited::VisitTypeAliasDecl(D); + } }; // Only allow a small portion of Decl's to be processed. Remove this once @@ -226,6 +240,8 @@ bool ODRHash::isWhitelistedDecl(const Decl *D, const CXXRecordDecl *Parent) { case Decl::CXXMethod: case Decl::Field: case Decl::StaticAssert: + case Decl::TypeAlias: + case Decl::Typedef: return true; } } @@ -313,6 +329,7 @@ public: void VisitTypedefType(const TypedefType *T) { AddDecl(T->getDecl()); + Hash.AddQualType(T->getDecl()->getUnderlyingType()); VisitType(T); } }; |