[PATCH] D77028: [NFC] Refactor DeferredDiagsEmitter and skip redundant visit

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 2 09:12:20 PDT 2020


yaxunl added inline comments.


================
Comment at: clang/lib/Sema/Sema.cpp:1508
   void checkFunc(SourceLocation Loc, FunctionDecl *FD) {
+    auto DiagsCountIt = DiagsCount.find(FD);
     FunctionDecl *Caller = UseStack.empty() ? nullptr : UseStack.back();
----------------
rjmccall wrote:
> It makes me a little uncomfortable to be holding an iterator this long while calling a fair amount of other stuff in the meantime.
> 
> Your use of DiagsCount is subtle enough that it really needs to be explained in some comments.  You're doing stuff conditionally based on both whether the entry exists but also whether it's non-zero.
added comments


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

https://reviews.llvm.org/D77028





More information about the cfe-commits mailing list