]> granicus.if.org Git - clang/commitdiff
Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to be
authorTed Kremenek <kremenek@apple.com>
Sat, 15 Dec 2007 00:39:18 +0000 (00:39 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 15 Dec 2007 00:39:18 +0000 (00:39 +0000)
so useful and introduced a few bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45051 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp
include/clang/AST/StmtIterator.h

index 08325fe3a472dcb6d0e7661a3cbf55990290ec06..9747c470806780ba0b3c78b5258a366e750b5317 100644 (file)
@@ -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
index eccee78ccb8cbe7ef04dc308da645c8b9b393c8f..ef6584121d0f9b702b1848e28bdad421bbbb629f 100644 (file)
@@ -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) {}