summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-03-16 18:37:27 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-03-16 18:37:27 +0000
commit7d8a0b52d4784c1c98081e355eed5d06749f5f47 (patch)
tree41aa5b7ec763f113c0b8786009ed0dd5791ae19e /clang/lib/AST/DeclPrinter.cpp
parent4828368dc824b575f0c7983eb9d3ec7aa27a2d7d (diff)
downloadbcm5719-llvm-7d8a0b52d4784c1c98081e355eed5d06749f5f47.tar.gz
bcm5719-llvm-7d8a0b52d4784c1c98081e355eed5d06749f5f47.zip
Support for printing/dumping static asserts
llvm-svn: 127744
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 27816323849..446b4d46464 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -54,6 +54,7 @@ namespace {
void VisitLabelDecl(LabelDecl *D);
void VisitParmVarDecl(ParmVarDecl *D);
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);
+ void VisitStaticAssertDecl(StaticAssertDecl *D);
void VisitNamespaceDecl(NamespaceDecl *D);
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
@@ -590,6 +591,14 @@ void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
Out << ")";
}
+void DeclPrinter::VisitStaticAssertDecl(StaticAssertDecl *D) {
+ Out << "static_assert(";
+ D->getAssertExpr()->printPretty(Out, Context, 0, Policy, Indentation);
+ Out << ", ";
+ D->getMessage()->printPretty(Out, Context, 0, Policy, Indentation);
+ Out << ")";
+}
+
//----------------------------------------------------------------------------
// C++ declarations
//----------------------------------------------------------------------------
OpenPOWER on IntegriCloud