From af458c9f658335bdea482395ff4a25c75935e129 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 26 Aug 2007 04:11:23 +0000 Subject: [PATCH] fix a bug introduced by the recent childification of ForStmt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41417 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Stmt.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index f341f8f112..20ecb860e0 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -410,13 +410,13 @@ public: 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(Cond); + SubExprs[INC] = reinterpret_cast(Inc); + SubExprs[BODY] = Body; + } Stmt *getInit() { return SubExprs[INIT]; } Expr *getCond() { return reinterpret_cast(SubExprs[COND]); } -- 2.40.0