]> granicus.if.org Git - clang/commitdiff
AST Dump: print the Inherited flag on attributes
authorHans Wennborg <hans@hanshq.net>
Sat, 31 May 2014 04:05:57 +0000 (04:05 +0000)
committerHans Wennborg <hans@hanshq.net>
Sat, 31 May 2014 04:05:57 +0000 (04:05 +0000)
Also move the attribute-specific dumping to after dumping this and
the Implicit flag.

Differential Revision: http://reviews.llvm.org/D3971

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209965 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTDumper.cpp
test/Misc/ast-dump-attr.cpp

index 14e0e0160d7679d34f60fdda30a747f7b0196128..548e042d2cf7d0a956a2ad6e1bfe0d52c936df65 100644 (file)
@@ -629,9 +629,11 @@ void ASTDumper::dumpAttr(const Attr *A) {
   }
   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 dde7ba3e094fd2218993c663ab208283280d52cc..1aa6adf79b09c3ae115f380a3cba096487d6155a 100644 (file)
@@ -108,7 +108,13 @@ namespace Test {
 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);