[cfe-commits] r41417 - /cfe/trunk/include/clang/AST/Stmt.h

Chris Lattner sabre at nondot.org
Sat Aug 25 21:11:24 PDT 2007


Author: lattner
Date: Sat Aug 25 23:11:23 2007
New Revision: 41417

URL: http://llvm.org/viewvc/llvm-project?rev=41417&view=rev
Log:
fix a bug introduced by the recent childification of ForStmt.

Modified:
    cfe/trunk/include/clang/AST/Stmt.h

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=41417&r1=41416&r2=41417&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Sat Aug 25 23:11:23 2007
@@ -410,13 +410,13 @@
 class ForStmt : public Stmt {
   enum { INIT, COND, INC, BODY, END_EXPR };
   Stmt* SubExprs[END_EXPR]; // SubExprs[INIT] is an expression or declstmt.
-  
-  Stmt *Init;  
-  Expr *Cond, *Inc;
-  Stmt *Body;
 public:
-  ForStmt(Stmt *init, Expr *cond, Expr *inc, Stmt *body)
-    : Stmt(ForStmtClass), Init(init), Cond(cond), Inc(inc), Body(body) {}
+  ForStmt(Stmt *Init, Expr *Cond, Expr *Inc, Stmt *Body) : Stmt(ForStmtClass) {
+    SubExprs[INIT] = Init;
+    SubExprs[COND] = reinterpret_cast<Stmt*>(Cond);
+    SubExprs[INC] = reinterpret_cast<Stmt*>(Inc);
+    SubExprs[BODY] = Body;
+  }
   
   Stmt *getInit() { return SubExprs[INIT]; }
   Expr *getCond() { return reinterpret_cast<Expr*>(SubExprs[COND]); }





More information about the cfe-commits mailing list