diff options
author | Michael Han <fragmentshaders@gmail.com> | 2013-02-22 17:15:32 +0000 |
---|---|---|
committer | Michael Han <fragmentshaders@gmail.com> | 2013-02-22 17:15:32 +0000 |
commit | 84324357b8e3870166bd29adf4c4eb83686644d4 (patch) | |
tree | 0d8c2a31b6bc5fe50f6d0d95f7d5df284176565f /clang/lib/AST/DeclPrinter.cpp | |
parent | adc1b070020c8badc664302b6bf2ac39bdf1b494 (diff) | |
download | bcm5719-llvm-84324357b8e3870166bd29adf4c4eb83686644d4.tar.gz bcm5719-llvm-84324357b8e3870166bd29adf4c4eb83686644d4.zip |
[Sema] Semantic analysis for empty-declaration and attribute-declaration.
Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.
llvm-svn: 175900
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index dce4f9af258..2be0b6c8046 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -51,6 +51,7 @@ namespace { void VisitEnumDecl(EnumDecl *D); void VisitRecordDecl(RecordDecl *D); void VisitEnumConstantDecl(EnumConstantDecl *D); + void VisitEmptyDecl(EmptyDecl *D); void VisitFunctionDecl(FunctionDecl *D); void VisitFriendDecl(FriendDecl *D); void VisitFieldDecl(FieldDecl *D); @@ -723,6 +724,11 @@ void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { Out << *D->getAliasedNamespace(); } +void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) { + prettyPrintAttributes(D); + Out << ";\n"; +} + void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { if (!Policy.SuppressSpecifiers && D->isModulePrivate()) Out << "__module_private__ "; |