add ast node for ifstmt
llvm-svn: 39051
diff --git a/clang/Sema/Sema.cpp b/clang/Sema/Sema.cpp
index 88d3168..0ff8c03 100644
--- a/clang/Sema/Sema.cpp
+++ b/clang/Sema/Sema.cpp
@@ -61,6 +61,10 @@
return Expr; // Exprs are Stmts.
}
+ virtual StmtResult ParseIfStmt(SourceLocation IfLoc, ExprTy *CondVal,
+ StmtTy *ThenVal, SourceLocation ElseLoc,
+ StmtTy *ElseVal);
+
virtual StmtResult ParseReturnStmt(SourceLocation ReturnLoc,
ExprTy *RetValExp);
@@ -195,6 +199,12 @@
return 0; // {} -> ;
}
+Action::StmtResult
+ASTBuilder::ParseIfStmt(SourceLocation IfLoc, ExprTy *CondVal,
+ StmtTy *ThenVal, SourceLocation ElseLoc,
+ StmtTy *ElseVal) {
+ return new IfStmt((Expr*)CondVal, (Stmt*)ThenVal, (Stmt*)ElseVal);
+}
Action::StmtResult
ASTBuilder::ParseReturnStmt(SourceLocation ReturnLoc,