[clang] [clang] Do not compute typo-correction suggestions for disabled diagnostics (PR #209694)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 11 04:54:51 PDT 2026
https://github.com/AaronBallman commented:
Thank you for looking into this! I'm surprised by the performance measurements because all of the diagnostics being checked are on by default. So this is a time savings only for people who disable those diagnostics, but:
https://sourcegraph.com/search?q=context:global+-file:.*test.*+-Wno-unknown-directives&patternType=keyword&sm=0
https://sourcegraph.com/search?q=context:global+-file:.*test.*+-Wno-unknown-attributes&patternType=keyword&sm=0
https://sourcegraph.com/search?q=context:global+-file:.*test.*+-Wno-attributes&patternType=keyword&sm=0
So the preprocessor check feels like it should be a net negative rather than a positive (though perhaps there's some performance value in checking for the known directives first, but I don't have a feel for how expensive that check is to perform).
The attribute changes seem more likely to buy us something because `-Wno-attributes` is reasonably common. How do the performance numbers compare with just the attribute carve-out? Do the numbers change if we skip only typo correction if the suggestion form is ignored or are the time savings from not doing any diagnostic work if the unknown attributes diagnostic is disabled?
https://github.com/llvm/llvm-project/pull/209694
More information about the cfe-commits
mailing list