[cfe-commits] r45051 - in /cfe/trunk: AST/Expr.cpp include/clang/AST/StmtIterator.h
Ted Kremenek
kremenek at apple.com
Fri Dec 14 16:39:18 PST 2007
Author: kremenek
Date: Fri Dec 14 18:39:18 2007
New Revision: 45051
URL: http://llvm.org/viewvc/llvm-project?rev=45051&view=rev
Log:
Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to be
so useful and introduced a few bugs.
Modified:
cfe/trunk/AST/Expr.cpp
cfe/trunk/include/clang/AST/StmtIterator.h
Modified: cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Expr.cpp?rev=45051&r1=45050&r2=45051&view=diff
==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Fri Dec 14 18:39:18 2007
@@ -1028,10 +1028,10 @@
// UnaryOperator
Stmt::child_iterator UnaryOperator::child_begin() {
- return child_iterator(reinterpret_cast<Stmt**>(&Val),Opc==SizeOf);
+ return reinterpret_cast<Stmt**>(&Val);
}
Stmt::child_iterator UnaryOperator::child_end() {
- return child_iterator(reinterpret_cast<Stmt**>(&Val)+1,Opc==SizeOf);
+ return reinterpret_cast<Stmt**>(&Val+1);
}
// SizeOfAlignOfTypeExpr
Modified: cfe/trunk/include/clang/AST/StmtIterator.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtIterator.h?rev=45051&r1=45050&r2=45051&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtIterator.h (original)
+++ cfe/trunk/include/clang/AST/StmtIterator.h Fri Dec 14 18:39:18 2007
@@ -25,8 +25,7 @@
class StmtIteratorBase {
protected:
- enum { DeclMode = 0x1, SizeOfTypeVAMode = 0x2,
- SizeExprMode = 0x3, Flags = 0x3 };
+ enum { DeclMode = 0x1, SizeOfTypeVAMode = 0x2, Flags = 0x3 };
union { Stmt** stmt; ScopedDecl* decl; };
uintptr_t RawVAPtr;
@@ -38,11 +37,7 @@
bool inSizeOfTypeVA() const {
return RawVAPtr & SizeOfTypeVAMode ? true : false;
}
-
- bool inSizeOfExpr() const {
- return RawVAPtr & SizeExprMode ? true : false;
- }
-
+
VariableArrayType* getVAPtr() const {
return reinterpret_cast<VariableArrayType*>(RawVAPtr & ~Flags);
}
@@ -57,10 +52,7 @@
Stmt*& GetDeclExpr() const;
- StmtIteratorBase(Stmt** s, bool inSizeOfExpr) : stmt(s), RawVAPtr(0) {
- if (inSizeOfExpr) RawVAPtr = SizeExprMode;
- }
-
+ StmtIteratorBase(Stmt** s) : stmt(s), RawVAPtr(0) {}
StmtIteratorBase(ScopedDecl* d);
StmtIteratorBase(VariableArrayType* t);
StmtIteratorBase() : stmt(NULL), RawVAPtr(0) {}
@@ -76,7 +68,7 @@
StmtIteratorImpl(const StmtIteratorBase& RHS) : StmtIteratorBase(RHS) {}
public:
StmtIteratorImpl() {}
- StmtIteratorImpl(Stmt** s, bool inSizeOfExpr) : StmtIteratorBase(s,inSizeOfExpr){}
+ StmtIteratorImpl(Stmt** s) : StmtIteratorBase(s) {}
StmtIteratorImpl(ScopedDecl* d) : StmtIteratorBase(d) {}
StmtIteratorImpl(VariableArrayType* t) : StmtIteratorBase(t) {}
@@ -117,8 +109,7 @@
struct StmtIterator : public StmtIteratorImpl<StmtIterator,Stmt*&> {
explicit StmtIterator() : StmtIteratorImpl<StmtIterator,Stmt*&>() {}
- StmtIterator(Stmt** S, bool inSizeOfExpr=false)
- : StmtIteratorImpl<StmtIterator,Stmt*&>(S,inSizeOfExpr) {}
+ StmtIterator(Stmt** S) : StmtIteratorImpl<StmtIterator,Stmt*&>(S) {}
StmtIterator(VariableArrayType* t):StmtIteratorImpl<StmtIterator,Stmt*&>(t) {}
StmtIterator(ScopedDecl* D) : StmtIteratorImpl<StmtIterator,Stmt*&>(D) {}
More information about the cfe-commits
mailing list