[clang-tools-extra] [clang-doc] Add start and end line numbers (PR #137732)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 29 14:51:11 PDT 2025
================
@@ -795,43 +787,52 @@ emitInfo(const CXXMethodDecl *D, const FullComment *FC, int LineNumber,
}
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
-emitInfo(const TypedefDecl *D, const FullComment *FC, int LineNumber,
- StringRef File, bool IsFileInRootDir, bool PublicOnly) {
- TypedefInfo Info;
+emitInfo(const TypedefDecl *D, const FullComment *FC, Location Loc,
+ bool PublicOnly) {
+ TypedefInfo Info;
+ ASTContext &Context = D->getASTContext();
bool IsInAnonymousNamespace = false;
populateInfo(Info, D, FC, IsInAnonymousNamespace);
+
if (!shouldSerializeInfo(PublicOnly, IsInAnonymousNamespace, D))
return {};
- Info.DefLoc.emplace(LineNumber, File, IsFileInRootDir);
+ Info.DefLoc = Loc;
auto &LO = D->getLangOpts();
Info.Underlying = getTypeInfoForType(D->getUnderlyingType(), LO);
+
if (Info.Underlying.Type.Name.empty()) {
// Typedef for an unnamed type. This is like "typedef struct { } Foo;"
// The record serializer explicitly checks for this syntax and constructs
// a record with that name, so we don't want to emit a duplicate here.
return {};
}
Info.IsUsing = false;
-
+ if (RawComment *Comment = D->getASTContext().getRawCommentForDeclNoCache(D)) {
+ Comment->setAttached();
+ if (comments::FullComment *Fc = Comment->parse(Context, nullptr, D)) {
+ Info.Description.emplace_back();
+ parseFullComment(Fc, Info.Description.back());
+ }
+ }
----------------
ilovepi wrote:
Removed.
https://github.com/llvm/llvm-project/pull/137732
More information about the cfe-commits
mailing list