Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart

Issue 669693002: Support unreachable code in blocks in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
index 850ff3ccfdc70f262d7dddbc88b3efea366644f5..30a79830e105bd36f6a00d22b382d176c11e45f7 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
@@ -597,6 +597,21 @@ class IrBuilder {
_current = null;
}
+ /// Create a blocks of [statements] by applying [build] to all reachable
+ /// statements.
+ // TODO(johnniwinther): Type [statements] as `Iterable` when `NodeList` uses
+ // `List` instead of `Link`.
+ void buildBlock(var statements, build(statement)) {
+ // Build(Block(stamements), C) = C'
+ // where C' = statements.fold(Build, C)
+ assert(isOpen);
+ for (var statement in statements) {
+ build(statement);
+ if (!isOpen) return;
+ }
+ }
+
+
// Build(BreakStatement L, C) = C[InvokeContinuation(...)]
//
// The continuation and arguments are filled in later after translating

Powered by Google App Engine
This is Rietveld 408576698