[clang-tools-extra] [clang-doc] Track Descriptions and TypeDeclaration for types (PR #138058)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 30 17:57:51 PDT 2025
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/138058
Split from #133161. This patch allows Typedefs to now track both their
declarations and full descriptions. Subsequent patches will leverage the
additional fields in the representation.
Co-authored-by: Peter Chou <peter.chou at mail.utoronto.ca>
>From 8e70c845c483a142bbef5603ff44c19c8ab11921 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Tue, 29 Apr 2025 18:21:02 -0700
Subject: [PATCH] [clang-doc] Track Descriptions and TypeDeclaration for types
Split from #133161. This patch allows Typedefs to now track both their
declarations and full descriptions. Subsequent patches will leverage the
additional fields in the representation.
Co-authored-by: Peter Chou <peter.chou at mail.utoronto.ca>
---
clang-tools-extra/clang-doc/Representation.h | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/clang-tools-extra/clang-doc/Representation.h b/clang-tools-extra/clang-doc/Representation.h
index b0b34fc6f08dd..1d5c4dcaeaf37 100644
--- a/clang-tools-extra/clang-doc/Representation.h
+++ b/clang-tools-extra/clang-doc/Representation.h
@@ -415,7 +415,13 @@ struct TypedefInfo : public SymbolInfo {
TypeInfo Underlying;
- // Inidicates if this is a new C++ "using"-style typedef:
+ // Underlying type declaration
+ SmallString<16> TypeDeclaration;
+
+ /// Comment description for the typedef.
+ std::vector<CommentInfo> Description;
+
+ // Indicates if this is a new C++ "using"-style typedef:
// using MyVector = std::vector<int>
// False means it's a C-style typedef:
// typedef std::vector<int> MyVector;
@@ -458,7 +464,8 @@ struct EnumValueInfo {
// constant. This will be empty for implicit enumeration values.
SmallString<16> ValueExpr;
- std::vector<CommentInfo> Description; /// Comment description of this field.
+ /// Comment description of this field.
+ std::vector<CommentInfo> Description;
};
// TODO: Expand to allow for documenting templating.
More information about the cfe-commits
mailing list