[PATCH] D77028: Speed up deferred diagnostic emitter

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 11:25:38 PDT 2020


yaxunl marked 2 inline comments as done.
yaxunl added inline comments.


================
Comment at: clang/lib/Sema/Sema.cpp:1558
+    // visited before.
+    if (Done.count(FD))
+      return;
----------------
rjmccall wrote:
> yaxunl wrote:
> > rjmccall wrote:
> > > `insert` returns whether it changed the set, so you can combine this check with the insertion unless the exact ordering is important.
> > The order is important here. We cannot inert until the body of the function has been traversed.
> Why?  It only matters if we encounter `FD` again while recursing into its body, during which time `InUsePath.count(FD)` will be true and so we'll have bailed out above.
You are right. I forgot InUsePath. Will fix this. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77028/new/

https://reviews.llvm.org/D77028





More information about the cfe-commits mailing list