diff options
author | Richard Trieu <rtrieu@google.com> | 2017-07-01 02:00:05 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-07-01 02:00:05 +0000 |
commit | 96b416496839657a59ccad6ef15d7737ef7f2695 (patch) | |
tree | 4b708a04247d4129768b6060aa13ad68fe99587a /clang/lib/AST/ODRHash.cpp | |
parent | 28082ab0e5f5e8875084ad00cd934f93006b2f90 (diff) | |
download | bcm5719-llvm-96b416496839657a59ccad6ef15d7737ef7f2695.tar.gz bcm5719-llvm-96b416496839657a59ccad6ef15d7737ef7f2695.zip |
[ODRHash] Revert r305104 - Skip inline namespaces when hashing.
Test inline namespaces and handle them in the ODR hash again.
llvm-svn: 306926
Diffstat (limited to 'clang/lib/AST/ODRHash.cpp')
-rw-r--r-- | clang/lib/AST/ODRHash.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp index 0e44a12257c..3f66e58eb86 100644 --- a/clang/lib/AST/ODRHash.cpp +++ b/clang/lib/AST/ODRHash.cpp @@ -82,25 +82,13 @@ void ODRHash::AddDeclarationName(DeclarationName Name) { } void ODRHash::AddNestedNameSpecifier(const NestedNameSpecifier *NNS) { - // Unlike the other pointer handling functions, allow null pointers here. - if (!NNS) { - AddBoolean(false); - return; + assert(NNS && "Expecting non-null pointer."); + const auto *Prefix = NNS->getPrefix(); + AddBoolean(Prefix); + if (Prefix) { + AddNestedNameSpecifier(Prefix); } - - // Skip inlined namespaces. auto Kind = NNS->getKind(); - if (Kind == NestedNameSpecifier::Namespace) { - if (NNS->getAsNamespace()->isInline()) { - return AddNestedNameSpecifier(NNS->getPrefix()); - } - } - - AddBoolean(true); - - // Process prefix - AddNestedNameSpecifier(NNS->getPrefix()); - ID.AddInteger(Kind); switch (Kind) { case NestedNameSpecifier::Identifier: @@ -441,7 +429,10 @@ public: } void AddNestedNameSpecifier(const NestedNameSpecifier *NNS) { - Hash.AddNestedNameSpecifier(NNS); + Hash.AddBoolean(NNS); + if (NNS) { + Hash.AddNestedNameSpecifier(NNS); + } } void AddIdentifierInfo(const IdentifierInfo *II) { |