Skip to content

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented May 1, 2025

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 [email protected]

@ilovepi ilovepi requested review from mysterymath and petrhosek May 1, 2025 00:57
@llvmbot
Copy link
Member

llvmbot commented May 1, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Paul Kirth (ilovepi)

Changes

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 <[email protected]>


Full diff: https://github.com/llvm/llvm-project/pull/138058.diff

1 Files Affected:

  • (modified) clang-tools-extra/clang-doc/Representation.h (+9-2)
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.

Copy link
Contributor Author

ilovepi commented May 1, 2025

note this whole stack lacks testing. I'll need to do that, or get help on that front, given that GSOC starts soon.

@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-improved-descriptions branch from 8e70c84 to de5258a Compare May 6, 2025 21:33
Copy link
Contributor Author

ilovepi commented May 7, 2025

Merge activity

  • May 6, 11:12 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • May 6, 11:14 PM EDT: Graphite rebased this pull request as part of a merge.
  • May 6, 11:16 PM EDT: @ilovepi merged this pull request with Graphite.

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 <[email protected]>
@ilovepi ilovepi force-pushed the users/ilovepi/clang-doc-improved-descriptions branch from de5258a to fe5424d Compare May 7, 2025 03:13
@ilovepi ilovepi merged commit 796652d into main May 7, 2025
6 of 10 checks passed
@ilovepi ilovepi deleted the users/ilovepi/clang-doc-improved-descriptions branch May 7, 2025 03:16
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
…8058)

Split from llvm#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants