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 | 6e026d67f860337eb40392d743aaddbd5e750537 (patch) | |
tree | f33c7eb4bc055d73a580a6a77a0d3ac798e85221 /lib | |
parent | c0534f87d0f8d3b6a50548d980252ec2cbf93bf2 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ODRHash.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/ODRHash.cpp b/lib/AST/ODRHash.cpp index 66b9940b8b..c16f4f336a 100644 --- a/lib/AST/ODRHash.cpp +++ b/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); } |