r209965 - AST Dump: print the Inherited flag on attributes
Hans Wennborg
hans at hanshq.net
Fri May 30 21:05:58 PDT 2014
Author: hans
Date: Fri May 30 23:05:57 2014
New Revision: 209965
URL: http://llvm.org/viewvc/llvm-project?rev=209965&view=rev
Log:
AST Dump: print the Inherited flag on attributes
Also move the attribute-specific dumping to after dumping this and
the Implicit flag.
Differential Revision: http://reviews.llvm.org/D3971
Modified:
cfe/trunk/lib/AST/ASTDumper.cpp
cfe/trunk/test/Misc/ast-dump-attr.cpp
Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=209965&r1=209964&r2=209965&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Fri May 30 23:05:57 2014
@@ -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, ...) {}
Modified: cfe/trunk/test/Misc/ast-dump-attr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-attr.cpp?rev=209965&r1=209964&r2=209965&view=diff
==============================================================================
--- cfe/trunk/test/Misc/ast-dump-attr.cpp (original)
+++ cfe/trunk/test/Misc/ast-dump-attr.cpp Fri May 30 23:05:57 2014
@@ -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);
More information about the cfe-commits
mailing list