Added "mode" to StmtIterator to record if the expression being iterated
over is the subexpression of a sizeof(expression). Different clients
will wish to handle iteration over such subexpressions differently, and can
now easily query if they are iterating over such statements using the
StmtIterator's inSizeOfExpr().
llvm-svn: 45047
diff --git a/clang/AST/Expr.cpp b/clang/AST/Expr.cpp
index 2276705..08325fe3 100644
--- a/clang/AST/Expr.cpp
+++ b/clang/AST/Expr.cpp
@@ -1028,10 +1028,10 @@
// UnaryOperator
Stmt::child_iterator UnaryOperator::child_begin() {
- return reinterpret_cast<Stmt**>(&Val);
+ return child_iterator(reinterpret_cast<Stmt**>(&Val),Opc==SizeOf);
}
Stmt::child_iterator UnaryOperator::child_end() {
- return reinterpret_cast<Stmt**>(&Val)+1;
+ return child_iterator(reinterpret_cast<Stmt**>(&Val)+1,Opc==SizeOf);
}
// SizeOfAlignOfTypeExpr