From 77e24936022add9e5a0b4ff3db99148c96d113af Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 6 Apr 2020 13:52:47 -0400 Subject: [PATCH] [NFC] Minor fix for deferred diagnostics emitter Differential Revision: https://reviews.llvm.org/D77028 --- clang/lib/Sema/Sema.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index ff184aa7f48d..6c1666162c81 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -1555,7 +1555,7 @@ public: emitDeferredDiags(FD, Caller); // Do not revisit a function if the function body has been completely // visited before. - if (Done.count(FD)) + if (!Done.insert(FD).second) return; InUsePath.insert(FD); UsePath.push_back(FD); @@ -1564,7 +1564,6 @@ public: } UsePath.pop_back(); InUsePath.erase(FD); - Done.insert(FD); } void checkRecordedDecl(Decl *D) {