add parsing, ast building and pretty printing support for C++ throw expressions.
Patch by Mike Stump!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47582 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ExprCXX.cpp b/AST/ExprCXX.cpp
index 0646823..3bc32e7 100644
--- a/AST/ExprCXX.cpp
+++ b/AST/ExprCXX.cpp
@@ -23,7 +23,6 @@
Stmt::child_iterator CXXCastExpr::child_begin() {
return reinterpret_cast<Stmt**>(&Op);
}
-
Stmt::child_iterator CXXCastExpr::child_end() {
return reinterpret_cast<Stmt**>(&Op)+1;
}
@@ -35,3 +34,14 @@
Stmt::child_iterator CXXBoolLiteralExpr::child_end() {
return child_iterator();
}
+
+// CXXThrowExpr
+Stmt::child_iterator CXXThrowExpr::child_begin() {
+ return reinterpret_cast<Stmt**>(&Op);
+}
+Stmt::child_iterator CXXThrowExpr::child_end() {
+ // If Op is 0, we are processing throw; which has no children.
+ if (Op == 0)
+ return reinterpret_cast<Stmt**>(&Op)+0;
+ return reinterpret_cast<Stmt**>(&Op)+1;
+}