[PATCH] D77028: [NFC] Refactor DeferredDiagsEmitter and skip redundant visit
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 22:18:49 PDT 2020
rjmccall 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();
----------------
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77028/new/
https://reviews.llvm.org/D77028
More information about the cfe-commits
mailing list