[PATCH] D43696: Reduce hash collisions for reference and pointer types

Richard Trieu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 20:29:53 PST 2018


rtrieu added inline comments.


================
Comment at: lib/AST/ODRHash.cpp:581
+  void VisitType(const Type *T) {
+    ID.AddInteger(T->getTypeClass());
+  }
----------------
v.g.vassilev wrote:
> rtrieu wrote:
> > rsmith wrote:
> > > This looks redundant, the above `Visit(const Type*)` function seems to already do this.
> > That's correct, VisitType is intended to be empty.  The TypeClass enum value is added in Visit so that it is the first value added to the data stream.
> Ok, then I am a little confused. If `VisitType` is supposed to be nop why we call it in all VisitXXX functions.
Each Type calls its parent Type, all the way up to Type.  It's just a manual traversal of the Type hierarchy.  Right now, there's nothing in VisitType, but there might be in the future.


Repository:
  rC Clang

https://reviews.llvm.org/D43696





More information about the cfe-commits mailing list