[clang] [clang-tools-extra] [clang] Don't add documentation comments to the AST if not requested (PR #206363)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 30 05:18:55 PDT 2026
================
@@ -1130,6 +1130,11 @@ class Sema final : public SemaBase {
void ActOnComment(SourceRange Comment);
+ /// Returns true if a comment at \p Loc should be retained in the AST
+ /// (some consumer such as -Wdocumentation, -fparse-all-comments, code
+ /// completion, or AST-file serialization may read it back).
+ bool shouldRetainCommentsFromLexer(SourceLocation Loc) const;
----------------
AaronBallman wrote:
```suggestion
bool shouldRetainCommentsInAST(SourceLocation Loc) const;
```
I think this is a bit more clear than `FromLexer`, but I don't insist either.
https://github.com/llvm/llvm-project/pull/206363
More information about the cfe-commits
mailing list