File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ namespace doc {
21
21
static llvm::StringSet USRVisited;
22
22
static llvm::sys::Mutex USRVisitedGuard;
23
23
24
+
25
+ template <typename T> bool isTypedefAnonRecord (const T* D) {
26
+ if (const auto *C = dyn_cast<CXXRecordDecl>(D)) {
27
+ if (const TypedefNameDecl *TD = C->getTypedefNameForAnonDecl ()) {
28
+ return true ;
29
+ }
30
+ }
31
+ return false ;
32
+ }
33
+
24
34
void MapASTVisitor::HandleTranslationUnit (ASTContext &Context) {
25
35
TraverseDecl (Context.getTranslationUnitDecl ());
26
36
}
@@ -44,7 +54,7 @@ template <typename T> bool MapASTVisitor::mapDecl(const T *D,
44
54
{
45
55
std::lock_guard<llvm::sys::Mutex> Guard (USRVisitedGuard);
46
56
StringRef Visited = USR.str ();
47
- if (USRVisited.count (Visited))
57
+ if (USRVisited.count (Visited) && !isTypedefAnonRecord<T>(D) )
48
58
return true ;
49
59
// We considered a USR to be visited only when its defined
50
60
if (IsDefinition)
You can’t perform that action at this time.
0 commit comments