================ @@ -12,16 +12,31 @@ #include "clang/AST/Comment.h" #include "clang/Index/USRGeneration.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/Support/Error.h" +#include "llvm/ADT/StringSet.h" +#include "llvm/Support/Mutex.h" namespace clang { namespace doc { +static llvm::StringSet USRVisited; +static llvm::sys::Mutex USRVisitedGuard; + + +template <typename T> bool isTypedefAnonRecord(const T* D) { + if (const auto *C = dyn_cast<CXXRecordDecl>(D)) { + if (const TypedefNameDecl *TD = C->getTypedefNameForAnonDecl()) { + return true; + } ---------------- ilovepi wrote:
```suggestion return C->getTypedefNameForAnonDecl(); ``` Isn't this just the same. You still need the outer return, but this doesn't need a branch and temporary. https://github.com/llvm/llvm-project/pull/96809 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits