[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:27 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;
----------------
ilovepi wrote:
Typically we prefer other set like containers over `unordered_set` (See https://llvm.org/docs/ProgrammersManual.html#other-set-like-container-options). https://llvm.org/docs/ProgrammersManual.html#set-like-containers-std-set-smallset-setvector-etc also lists some other alternatives, but likely you want `StringSet`.
https://github.com/llvm/llvm-project/pull/96809
More information about the cfe-commits
mailing list