Open higher-performance opened 1 year ago
I have started working on this (testing the AST matcher docs) over the past week. It might take some time to create something that works, but I plan to post an RFC (if appropriate) once I have a working implementation to discuss what the implementation should look like before opening a pr to discuss details.
Thank you. I think I also discovered another one in the documentation of ignoringImplicit
.
I thought I would give an update. My implementation works well, but there are is still a lot of things to do feature wise and re-checking the documentation a few more times. Here are some statistics from my generator:
Statistics:
doxygen_blocks : 515
missing_tests : 220
matcher_groups_without_matches: 33
code_snippets : 309
matches : 444
matchers : 361
tested_matchers : 311
skipped_objc : 16
compile_failures : 13
skipped_cuda : 2
All the current 311 tested matchers pass, but one of my To-dos is checking if they actually test what they should :)
One example would be the ignoringImplicit
example, which I have deleted for now.
I've opened a pr with my changes which will test the documentation of AST matchers, and I added additional examples to matchers that did not have any.
I've noticed some of the AST matcher documentation seems to be wrong (likely outdated). For example, this
https://github.com/llvm/llvm-project/blob/399eb5632f4ad201bfe4f0bbe1f8ce302c711726/clang/docs/LibASTMatchersReference.html#L2331-L2339
claims that
is matched by
but that doesn't seem to be the case.
Could the document test cases be verified/updated?
I suspect it may be worthwhile to do this automatically as part of CI, rather than manually.