AST for objective-c's @throw statement and its pretty-printing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43802 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Stmt.cpp b/AST/Stmt.cpp
index 8e1abda..28681c6 100644
--- a/AST/Stmt.cpp
+++ b/AST/Stmt.cpp
@@ -209,3 +209,11 @@
   return &SubStmts[0]+END_TRY; 
 }
 
+// ObjcAtThrowStmt
+Stmt::child_iterator ObjcAtThrowStmt::child_begin() {
+  return &Throw;
+}
+
+Stmt::child_iterator ObjcAtThrowStmt::child_end() {
+  return &Throw+1;
+}
diff --git a/AST/StmtPrinter.cpp b/AST/StmtPrinter.cpp
index d42a166..7fa553d 100644
--- a/AST/StmtPrinter.cpp
+++ b/AST/StmtPrinter.cpp
@@ -361,6 +361,15 @@
   Indent() << "@catch (...) { /* todo */ } \n";
 }
 
+void StmtPrinter::VisitObjcAtThrowStmt (ObjcAtThrowStmt *Node) {
+  Indent() << "@throw";
+  if (Node->getThrowExpr()) {
+    OS << " ";
+    PrintExpr(Node->getThrowExpr());
+  }
+  OS << ";\n";
+}
+
 //===----------------------------------------------------------------------===//
 //  Expr printing methods.
 //===----------------------------------------------------------------------===//