diff options
author | Richard Trieu <rtrieu@google.com> | 2017-07-14 01:36:41 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-07-14 01:36:41 +0000 |
commit | 9747a7c5622c42a88d868ee0220cdef8ed387781 (patch) | |
tree | 157508d2b9fbd8bffdebadd6d330242969092348 /clang/lib/AST/ODRHash.cpp | |
parent | 7641d962da225993937b972368e21a1641366ada (diff) | |
download | bcm5719-llvm-9747a7c5622c42a88d868ee0220cdef8ed387781.tar.gz bcm5719-llvm-9747a7c5622c42a88d868ee0220cdef8ed387781.zip |
[ODRHash] Avoid taking the types of FunctionDecl's
FunctionDecl already hashes most of the information in the function's type.
Add hashing of the return type, and skip hashing the function's type to avoid
redundancy and extra work when computing the hash.
llvm-svn: 307986
Diffstat (limited to 'clang/lib/AST/ODRHash.cpp')
-rw-r--r-- | clang/lib/AST/ODRHash.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp index 66b9940b8b0..c16f4f336af 100644 --- a/clang/lib/AST/ODRHash.cpp +++ b/clang/lib/AST/ODRHash.cpp @@ -246,7 +246,9 @@ public: } void VisitValueDecl(const ValueDecl *D) { - AddQualType(D->getType()); + if (!isa<FunctionDecl>(D)) { + AddQualType(D->getType()); + } Inherited::VisitValueDecl(D); } @@ -305,6 +307,8 @@ public: Hash.AddSubDecl(Param); } + AddQualType(D->getReturnType()); + Inherited::VisitFunctionDecl(D); } |