PeterChou1 wrote:

I did some more investigating and ran this patch against several different 
projects like llvm itself, and other well know libraries like zlib. The only 
functional difference I found was differences in the USR generated and 
generation order in the table genned files

The one exceptions to this is we accidently overlooked anonymous typedef like
```
typedef struct {} Foo; 
```
This causes the recursiveASTVisitor to visit the declaration once as a typedef 
and another time as a record. Originally we had the following 
[code](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-doc/Serialize.cpp#L777)
 which guards against emitting duplicate code when visiting an anonmymous 
typedef. 
This patch breaks from the previous behaviour since once we have visit the 
anonymous typedef we add the typedef to the memoization list but the guard 
prevents it from getting serialized. And next time we visit it as a record the 
USR is already in the list which causes clang-doc to skip it again, leaving 
nothing to be emitted.

To prevent this I added a check for if a decl is an anonymous typedef and cause 
it to always process the decl regardless or not if its in the memoization list




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

Reply via email to