diff options
author | Richard Trieu <rtrieu@google.com> | 2017-07-08 02:04:42 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-07-08 02:04:42 +0000 |
commit | bd8aa3a7c974c9404a21faf306aad785cf0a7549 (patch) | |
tree | 098821f209c56dd41e0a35000e74da72578d82c4 /lib/AST | |
parent | b5b856017423174ef4ffea2956143ba6139823d7 (diff) |
[ODRHash] Support FriendDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/ODRHash.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/AST/ODRHash.cpp b/lib/AST/ODRHash.cpp index 3f66e58eb8..66b9940b8b 100644 --- a/lib/AST/ODRHash.cpp +++ b/lib/AST/ODRHash.cpp @@ -228,6 +228,13 @@ public: Hash.AddQualType(T); } + void AddDecl(const Decl *D) { + Hash.AddBoolean(D); + if (D) { + Hash.AddDecl(D); + } + } + void Visit(const Decl *D) { ID.AddInteger(D->getKind()); Inherited::Visit(D); @@ -321,6 +328,16 @@ public: void VisitTypeAliasDecl(const TypeAliasDecl *D) { Inherited::VisitTypeAliasDecl(D); } + + void VisitFriendDecl(const FriendDecl *D) { + TypeSourceInfo *TSI = D->getFriendType(); + Hash.AddBoolean(TSI); + if (TSI) { + AddQualType(TSI->getType()); + } else { + AddDecl(D->getFriendDecl()); + } + } }; // Only allow a small portion of Decl's to be processed. Remove this once @@ -335,6 +352,7 @@ bool ODRHash::isWhitelistedDecl(const Decl *D, const CXXRecordDecl *Parent) { case Decl::AccessSpec: case Decl::CXXMethod: case Decl::Field: + case Decl::Friend: case Decl::StaticAssert: case Decl::TypeAlias: case Decl::Typedef: |