[PATCH] AST Dump: print the Inherited flag on attributes
Hans Wennborg
hans at chromium.org
Fri May 30 21:13:39 PDT 2014
Closed by commit rL209965 (authored by @hans).
http://reviews.llvm.org/D3971
Files:
cfe/trunk/lib/AST/ASTDumper.cpp
cfe/trunk/test/Misc/ast-dump-attr.cpp
Index: cfe/trunk/lib/AST/ASTDumper.cpp
===================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp
+++ cfe/trunk/lib/AST/ASTDumper.cpp
@@ -629,9 +629,11 @@
}
dumpPointer(A);
dumpSourceRange(A->getRange());
-#include "clang/AST/AttrDump.inc"
+ if (A->isInherited())
+ OS << " Inherited";
if (A->isImplicit())
OS << " Implicit";
+#include "clang/AST/AttrDump.inc"
}
static void dumpPreviousDeclImpl(raw_ostream &OS, ...) {}
Index: cfe/trunk/test/Misc/ast-dump-attr.cpp
===================================================================
--- cfe/trunk/test/Misc/ast-dump-attr.cpp
+++ cfe/trunk/test/Misc/ast-dump-attr.cpp
@@ -108,7 +108,13 @@
extern "C" int printf(const char *format, ...);
// CHECK: FunctionDecl{{.*}}printf
// CHECK-NEXT: ParmVarDecl{{.*}}format{{.*}}'const char *'
-// CHECK-NEXT: FormatAttr{{.*}}printf 1 2 Implicit
+// CHECK-NEXT: FormatAttr{{.*}}Implicit printf 1 2
+
+alignas(8) extern int x;
+extern int x;
+// CHECK: VarDecl{{.*}} x 'int'
+// CHECK: VarDecl{{.*}} x 'int'
+// CHECK-NEXT: AlignedAttr{{.*}} Inherited
}
int __attribute__((cdecl)) TestOne(void), TestTwo(void);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3971.9978.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140531/f3c45f82/attachment.bin>
More information about the cfe-commits
mailing list