Bug #:
Submitted by:
Reviewed by:
Implement some FIXME's that stand in the way of fully typechecking "for"
statements. This involved:
- Adding a DeclStmt AST node (with statement visitor). The DeclStmt
printer is preliminary.
- Added a ParseDeclStmt action, called from Parser::ParseForStatement()
and Parser::ParseStatementOrDeclaration(). DID NOT add to
Parser::ParseIdentifierStatement()...probably could have, however didn't
really understand the context of this rule (will speak with Chris).
- Removed ParseExprStmt (and it's clients)...it was vestigial.
llvm-svn: 39518
diff --git a/clang/Sema/SemaStmt.cpp b/clang/Sema/SemaStmt.cpp
index 7f9d471..ebc0722 100644
--- a/clang/Sema/SemaStmt.cpp
+++ b/clang/Sema/SemaStmt.cpp
@@ -25,6 +25,9 @@
return new NullStmt(SemiLoc);
}
+Sema::StmtResult Sema::ParseDeclStmt(DeclTy *decl) {
+ return decl ? new DeclStmt(static_cast<Decl *>(decl)) : 0;
+}
Action::StmtResult
Sema::ParseCompoundStmt(SourceLocation L, SourceLocation R,