summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ODRHash.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2017-07-08 02:04:42 +0000
committerRichard Trieu <rtrieu@google.com>2017-07-08 02:04:42 +0000
commitac6a1b6417eee05e4aa32a481b0e39a97ade501a (patch)
tree6ca0f1e32e971edce38161505fa5552d8180e79e /clang/lib/AST/ODRHash.cpp
parent8737f0650c050918a50504647ac02f137b3a00ad (diff)
downloadbcm5719-llvm-ac6a1b6417eee05e4aa32a481b0e39a97ade501a.tar.gz
bcm5719-llvm-ac6a1b6417eee05e4aa32a481b0e39a97ade501a.zip
[ODRHash] Support FriendDecl
llvm-svn: 307458
Diffstat (limited to 'clang/lib/AST/ODRHash.cpp')
-rw-r--r--clang/lib/AST/ODRHash.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp
index 3f66e58eb86..66b9940b8b0 100644
--- a/clang/lib/AST/ODRHash.cpp
+++ b/clang/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:
OpenPOWER on IntegriCloud