v.g.vassilev created this revision. v.g.vassilev added reviewers: rtrieu, rsmith.
While investigating the work done in D41416 <https://reviews.llvm.org/D41416> I found out that the hash values for pointer and reference types are the same. Repository: rC Clang https://reviews.llvm.org/D43696 Files: lib/AST/ODRHash.cpp Index: lib/AST/ODRHash.cpp =================================================================== --- lib/AST/ODRHash.cpp +++ lib/AST/ODRHash.cpp @@ -577,7 +577,19 @@ Inherited::Visit(T); } - void VisitType(const Type *T) {} + void VisitType(const Type *T) { + ID.AddInteger(T->getTypeClass()); + } + + void VisitPointerType(const PointerType *T) { + AddQualType(T->getPointeeType()); + VisitType(T); + } + + void VisitReferenceType(const ReferenceType *T) { + AddQualType(T->getPointeeType()); + VisitType(T); + } void VisitAdjustedType(const AdjustedType *T) { AddQualType(T->getOriginalType());
Index: lib/AST/ODRHash.cpp =================================================================== --- lib/AST/ODRHash.cpp +++ lib/AST/ODRHash.cpp @@ -577,7 +577,19 @@ Inherited::Visit(T); } - void VisitType(const Type *T) {} + void VisitType(const Type *T) { + ID.AddInteger(T->getTypeClass()); + } + + void VisitPointerType(const PointerType *T) { + AddQualType(T->getPointeeType()); + VisitType(T); + } + + void VisitReferenceType(const ReferenceType *T) { + AddQualType(T->getPointeeType()); + VisitType(T); + } void VisitAdjustedType(const AdjustedType *T) { AddQualType(T->getOriginalType());
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits