diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-05-31 04:05:57 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-05-31 04:05:57 +0000 |
| commit | b0a8b4ac5ff6802b22311ae895257b95693eb902 (patch) | |
| tree | 35411c5d49b622c0f3987bf64cbf4547c4256ed3 | |
| parent | e9ffe3aeb9b644230af0a32fbb108b6d858f9627 (diff) | |
| download | bcm5719-llvm-b0a8b4ac5ff6802b22311ae895257b95693eb902.tar.gz bcm5719-llvm-b0a8b4ac5ff6802b22311ae895257b95693eb902.zip | |
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
llvm-svn: 209965
| -rw-r--r-- | clang/lib/AST/ASTDumper.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Misc/ast-dump-attr.cpp | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index 14e0e0160d7..548e042d2cf 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -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, ...) {} diff --git a/clang/test/Misc/ast-dump-attr.cpp b/clang/test/Misc/ast-dump-attr.cpp index dde7ba3e094..1aa6adf79b0 100644 --- a/clang/test/Misc/ast-dump-attr.cpp +++ b/clang/test/Misc/ast-dump-attr.cpp @@ -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); |

