[clang-tools-extra] [clang-doc] Add Markdown AST node type definitions (PR #205609)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 28 07:47:04 PDT 2026
================
@@ -214,52 +202,53 @@ struct OrderedListNode : BlockNode {
struct BlockQuoteNode : BlockNode {
BlockList Children;
BlockQuoteNode() : BlockNode(NodeKind::NK_BlockQuote) {}
- void dump(llvm::raw_ostream &OS = llvm::errs()) const {
- OS << "BlockQuoteNode\n";
- }
+ void print(llvm::raw_ostream &OS) const;
+ LLVM_DUMP_METHOD void dump() const;
static bool classof(const BlockNode *N) {
return N->Kind == NodeKind::NK_BlockQuote;
}
};
struct ThematicBreakNode : BlockNode {
ThematicBreakNode() : BlockNode(NodeKind::NK_ThematicBreak) {}
- void dump(llvm::raw_ostream &OS = llvm::errs()) const {
- OS << "ThematicBreakNode\n";
- }
+ void print(llvm::raw_ostream &OS) const;
+ LLVM_DUMP_METHOD void dump() const;
static bool classof(const BlockNode *N) {
return N->Kind == NodeKind::NK_ThematicBreak;
}
};
struct DocumentNode : BlockNode {
+ // FIXME: add constructor that accepts children once parser is in place
BlockList Children;
DocumentNode() : BlockNode(NodeKind::NK_Document) {}
- void dump(llvm::raw_ostream &OS = llvm::errs()) const {
- OS << "DocumentNode\n";
- }
+ void print(llvm::raw_ostream &OS) const;
+ LLVM_DUMP_METHOD void dump() const;
static bool classof(const BlockNode *N) {
return N->Kind == NodeKind::NK_Document;
}
};
//===----------------------------------------------------------------------===//
----------------
ilovepi wrote:
Not sure this comment block is pulling much weight. You're probably better served by adding documentation to the class itself.
Also everything is in markdown.cpp/h, you may want to consider at what point keeping everything in a single TU is no longer the best choice, and what that division would look like.
https://github.com/llvm/llvm-project/pull/205609
More information about the cfe-commits
mailing list