[PATCH] D55492: Implement Attr dumping in terms of visitors
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 10 07:41:23 PST 2019
aaron.ballman added inline comments.
================
Comment at: include/clang/AST/TextNodeDumper.h:187
+
+// Implements Visit methods for Attrs
+#include "clang/AST/AttrTextNodeDump.inc"
----------------
Add a full stop to the end of the comment.
================
Comment at: lib/AST/ASTDumper.cpp:89
// Utilities
- void dumpType(QualType T) { NodeDumper.dumpType(T); }
void dumpTypeAsChild(QualType T);
----------------
This seems unrelated to this patch (same below) ?
================
Comment at: lib/AST/ASTDumper.cpp:443
+
+// Implements Visit methods for Attrs
+#include "clang/AST/AttrNodeTraverse.inc"
----------------
Full stop here as well.
================
Comment at: lib/AST/TextNodeDumper.cpp:44-45
+void TextNodeDumper::Visit(const Attr *A) {
+ {
+ ColorScope Color(OS, ShowColors, AttrColor);
----------------
Formatting is incorrect.
================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:3726
+ functionContent = SS.str();
+ if (SS.tell()) {
+ OS << " void Visit" << R.getName() << "Attr(const " << R.getName()
----------------
steveire wrote:
> aaron.ballman wrote:
> > Wouldn't this be `!FunctionContent.empty()`?
> I would have thought so, but apparently that's not how `raw_string_ostream` works. I get an empty file from this if I do that.
Huh, good to know.
================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:3738
+void EmitClangAttrNodeTraverse(RecordKeeper &Records, raw_ostream &OS) {
+ emitSourceFileHeader("Attribute text node dumper", OS);
+
----------------
The source file comment will be incorrect. This emits the node traverser not the dumper.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55492/new/
https://reviews.llvm.org/D55492
More information about the cfe-commits
mailing list