[PATCH] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 14:27:53 PST 2018


v.g.vassilev updated this revision to Diff 128797.
v.g.vassilev added a comment.

Reduce hash collisions for template specializations.

Currently when we hash a tag type the visitor calls `ODRHash::AddDecl` which mostly relies on the decl name give distinct hash value. The types coming from template specializations have very similar properties (including decl names). For those we need to provide more information in order to disambiguate them.

This patch adds the template arguments for the template specialization decl corresponding to its type. We manage to reduce further the amount of deserializations from 1117 down to 451.


https://reviews.llvm.org/D41416

Files:
  include/clang/AST/DeclTemplate.h
  lib/AST/DeclTemplate.cpp
  lib/AST/ODRHash.cpp
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTReaderDecl.cpp
  lib/Serialization/ASTWriter.cpp
  lib/Serialization/ASTWriterDecl.cpp
  test/Modules/cxx-templates.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41416.128797.patch
Type: text/x-patch
Size: 27079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180105/5b141387/attachment-0001.bin>


More information about the cfe-commits mailing list