mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 13:31:04 +01:00
Collapse Sequence into Block. (#927)
This commit is contained in:
@@ -51,18 +51,10 @@ static void ResolveControlFlow(
|
||||
}
|
||||
return;
|
||||
}
|
||||
case Statement::Kind::Sequence: {
|
||||
auto& seq = cast<Sequence>(*statement);
|
||||
ResolveControlFlow(&seq.statement(), function, loop);
|
||||
if (seq.next().has_value()) {
|
||||
ResolveControlFlow(*seq.next(), function, loop);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case Statement::Kind::Block: {
|
||||
auto& block = cast<Block>(*statement);
|
||||
if (block.sequence().has_value()) {
|
||||
ResolveControlFlow(*block.sequence(), function, loop);
|
||||
for (auto* block_statement : block.statements()) {
|
||||
ResolveControlFlow(block_statement, function, loop);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user