[cfe-commits] [PATCH] Implement Attr dumping for -ast-dump

Philip Craig philipjcraig at gmail.com
Fri Dec 21 22:00:38 PST 2012


  I added a test for clang::fallthrough as part of AttributedStmt. My goal with the tests was just to test each type of attribute argument for code coverage, rather than exhaustive testing of all attributes. The other C++ attributes don't provide any more code coverage, so I didn't add them.


================
Comment at: lib/AST/ASTDumper.cpp:317
@@ +316,3 @@
+    IndentScope Indent(*this);
+    Attr *A = *I;
+    switch (A->getKind()) {
----------------
Alexander Kornienko wrote:
> const Attr *A ?
Fixed.

================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:1245
@@ +1244,3 @@
+void EmitClangAttrDump(RecordKeeper &Records, raw_ostream &OS) {
+  OS << "  switch (A->getKind()) {\n";
+  OS << "  default:\n";
----------------
Alexander Kornienko wrote:
> I'd better let the compiler concatenate strings:
> OS <<
>   "  switch... {\n"
>   "  case xx:\n"
>   "  ...";
Fixed.

================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:1243
@@ -1165,1 +1242,3 @@
 
+// Emits the code to dump an attribute.
+void EmitClangAttrDump(RecordKeeper &Records, raw_ostream &OS) {
----------------
Alexander Kornienko wrote:
> Should it better be a Doxygen comment?
It would be the only Doxygen comment in the file, so not sure that would add any value. It's a fairly meaningless comment as it is. I was just keeping with the style of the rest of the file.


http://llvm-reviews.chandlerc.com/D234



More information about the cfe-commits mailing list