Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to be

so useful and introduced a few bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45051 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2007-12-15 00:39:18 +00:00
Родитель b51d2b2d54
Коммит f816f77480
2 изменённых файлов: 7 добавлений и 16 удалений

Просмотреть файл

@ -1028,10 +1028,10 @@ Stmt::child_iterator ParenExpr::child_end() {
// 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

Просмотреть файл

@ -25,8 +25,7 @@ class VariableArrayType;
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 @@ protected:
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 @@ protected:
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 @@ protected:
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 @@ public:
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) {}