diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-12-14 23:40:56 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-12-14 23:40:56 +0000 |
commit | b51d2b2d5497693783338c58dd778b6427e85ba7 (patch) | |
tree | 9d8fc1b103c720519e595af31d8160df67ac4972 /AST | |
parent | 58dbdeb69c063f82d644504fc638120198f7fad2 (diff) |
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().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST')
-rw-r--r-- | AST/Expr.cpp | 4 | ||||
-rw-r--r-- | AST/StmtIterator.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/AST/Expr.cpp b/AST/Expr.cpp index 22767053db..08325fe3a4 100644 --- a/AST/Expr.cpp +++ b/AST/Expr.cpp @@ -1028,10 +1028,10 @@ Stmt::child_iterator ParenExpr::child_end() { // 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 diff --git a/AST/StmtIterator.cpp b/AST/StmtIterator.cpp index 94a539770f..b72e9168ed 100644 --- a/AST/StmtIterator.cpp +++ b/AST/StmtIterator.cpp @@ -49,7 +49,7 @@ void StmtIteratorBase::NextVA() { } void StmtIteratorBase::NextDecl(bool ImmediateAdvance) { - assert (inDeclMode()); + assert (inDecl()); assert (getVAPtr() == NULL); assert (decl); @@ -97,7 +97,7 @@ StmtIteratorBase::StmtIteratorBase(ScopedDecl* d) } StmtIteratorBase::StmtIteratorBase(VariableArrayType* t) -: decl(NULL), RawVAPtr(VASizeMode) { +: decl(NULL), RawVAPtr(SizeOfTypeVAMode) { RawVAPtr |= reinterpret_cast<uintptr_t>(t); } |