[PATCH] D73675: Avoid many std::tie/tuple instantiations in ASTImporter

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 29 17:09:12 PST 2020


rnk created this revision.
rnk added reviewers: rsmith, aaron.ballman, a_sidorin.
Herald added a reviewer: martong.
Herald added a reviewer: a.sidorin.
Herald added a reviewer: shafik.
Herald added a subscriber: teemperor.
Herald added a project: clang.

Use in-out parameters to avoid making std::tuple values. This change
uses `auto` gratuitously, but I think it actually makes the code more
uniform and more readable. The importer is trying to treat AST nodes in
a uniform way, so I think we can make an exception to the usual coding
standards.

After:

  peak memory: 604.51MB
  real: 0m19.313s
  obj size: 8,404kb

Before:

  peak memory: 954.11MB
  real: 0m26.188s
  obj size: 10,000kb

The speed is not as impressive as I hoped, but the memory use reduction
is impressive, and seems worth it.

Depends on D73667 <https://reviews.llvm.org/D73667>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73675

Files:
  clang/lib/AST/ASTImporter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73675.241326.patch
Type: text/x-patch
Size: 88728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200130/3276f5f2/attachment-0001.bin>


More information about the cfe-commits mailing list