[clang-tools-extra] [clang-doc] Improve performance by adding a short circuit (PR #96809)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 26 18:02:29 PDT 2024


================
@@ -12,16 +12,25 @@
 #include "clang/AST/Comment.h"
 #include "clang/Index/USRGeneration.h"
 #include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Error.h"
+#include "llvm/Support/Mutex.h"
+#include <unordered_set>
 
 namespace clang {
 namespace doc {
 
+
+static std::unordered_set<std::string> USRVisited;
+
+static llvm::sys::Mutex USRVisitedGuard;
+
+
+
----------------
ilovepi wrote:

nit: extra newlines

https://github.com/llvm/llvm-project/pull/96809


More information about the cfe-commits mailing list