[IDE] Remove support for C-style ForStmt

This commit is contained in:
Rintaro Ishizaki
2017-08-04 14:32:37 +09:00
parent a375267e5c
commit b754b9e9b6
4 changed files with 0 additions and 31 deletions

View File

@@ -585,33 +585,6 @@ std::pair<bool, Stmt *> ModelASTWalker::walkToStmtPre(Stmt *S) {
addExprElem(SyntaxStructureElementKind::Expr, ForEachS->getSequence(),SN);
pushStructureNode(SN, S);
} else if (auto *ForS = dyn_cast<ForStmt>(S)) {
SyntaxStructureNode SN;
SN.Kind = SyntaxStructureKind::ForStatement;
SN.Range = charSourceRangeFromSourceRange(SM, S->getSourceRange());
if (!ForS->getInitializerVarDecls().empty()) {
auto InitDs = ForS->getInitializerVarDecls();
// Initializer decls come as a PatternBindingDecl followed by VarDecl's
// for each pattern set up. The PBD covers the whole initializer.
assert(isa<PatternBindingDecl>(InitDs[0]));
SourceRange ElemRange = InitDs[0]->getSourceRange();
SN.Elements.emplace_back(SyntaxStructureElementKind::InitExpr,
charSourceRangeFromSourceRange(SM, ElemRange));
} else if (ForS->getInitializer()) {
addExprElem(SyntaxStructureElementKind::InitExpr,
ForS->getInitializer().get(), SN);
}
if (ForS->getCond()) {
addExprElem(SyntaxStructureElementKind::Expr, ForS->getCond().get(), SN);
}
if (ForS->getIncrement()) {
addExprElem(SyntaxStructureElementKind::Expr, ForS->getIncrement().get(),
SN);
}
pushStructureNode(SN, S);
} else if (auto *WhileS = dyn_cast<WhileStmt>(S)) {
SyntaxStructureNode SN;
SN.Kind = SyntaxStructureKind::WhileStatement;