[clang-tools-extra] [clang-doc] add support for enums comments in html generation (PR #101282)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 9 15:50:28 PDT 2024
================
@@ -394,10 +394,20 @@ static void parseEnumerators(EnumInfo &I, const EnumDecl *D) {
std::string ValueExpr;
if (const Expr *InitExpr = E->getInitExpr())
ValueExpr = getSourceCode(D, InitExpr->getSourceRange());
-
SmallString<16> ValueStr;
E->getInitVal().toString(ValueStr);
- I.Members.emplace_back(E->getNameAsString(), ValueStr, ValueExpr);
+ I.Members.emplace_back(E->getNameAsString(), ValueStr.str(), ValueExpr);
+ ASTContext &Context = E->getASTContext();
+ RawComment *Comment = E->getASTContext().getRawCommentForDeclNoCache(E);
+ if (Comment) {
----------------
ilovepi wrote:
```suggestion
if(RawComment *Comment = E->getASTContext().getRawCommentForDeclNoCache(E)){
```
https://github.com/llvm/llvm-project/pull/101282
More information about the cfe-commits
mailing list