diff options
author | Richard Trieu <rtrieu@google.com> | 2018-04-12 02:26:49 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-04-12 02:26:49 +0000 |
commit | caaccee77d323e55c92b7ceccdbba0a99fad4e2b (patch) | |
tree | 7537c1f147e48fe69306f12b22590ae3b35b6ffb /clang/lib/AST/ODRHash.cpp | |
parent | 48ee59b6f05d46a0d4996e920ca702374a979873 (diff) | |
download | bcm5719-llvm-caaccee77d323e55c92b7ceccdbba0a99fad4e2b.tar.gz bcm5719-llvm-caaccee77d323e55c92b7ceccdbba0a99fad4e2b.zip |
[ODRHash] Skip more types hashing TypedefType
To get the underlying type for TypedefType's, also skip ElaboratedType's.
llvm-svn: 329869
Diffstat (limited to 'clang/lib/AST/ODRHash.cpp')
-rw-r--r-- | clang/lib/AST/ODRHash.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp index 528e32aaba2..0ee30fbd9b2 100644 --- a/clang/lib/AST/ODRHash.cpp +++ b/clang/lib/AST/ODRHash.cpp @@ -646,9 +646,19 @@ public: AddDecl(T->getDecl()); QualType UnderlyingType = T->getDecl()->getUnderlyingType(); VisitQualifiers(UnderlyingType.getQualifiers()); - while (const TypedefType *Underlying = - dyn_cast<TypedefType>(UnderlyingType.getTypePtr())) { - UnderlyingType = Underlying->getDecl()->getUnderlyingType(); + while (true) { + if (const TypedefType *Underlying = + dyn_cast<TypedefType>(UnderlyingType.getTypePtr())) { + UnderlyingType = Underlying->getDecl()->getUnderlyingType(); + continue; + } + if (const ElaboratedType *Underlying = + dyn_cast<ElaboratedType>(UnderlyingType.getTypePtr())) { + UnderlyingType = Underlying->getNamedType(); + continue; + } + + break; } AddType(UnderlyingType.getTypePtr()); VisitType(T); |