Skip to content

Commit 97cfd05

Browse files
author
Dart CI
committed
Version 2.12.0-108.0.dev
Merge commit 'ca5853779b4839a3bab54e49bfb2927b06394d06' into 'dev'
2 parents 49f7691 + ca58537 commit 97cfd05

25 files changed

+1977
-1801
lines changed

pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,36 +1423,6 @@ class FlowModel<Variable, Type> {
14231423
}
14241424
}
14251425

1426-
/// Updates the state to indicate that variables that are not definitely
1427-
/// unassigned in the [other], are also not definitely unassigned in the
1428-
/// result.
1429-
FlowModel<Variable, Type> joinUnassigned(FlowModel<Variable, Type> other) {
1430-
Map<Variable, VariableModel<Variable, Type>> newVariableInfo;
1431-
1432-
void markNotUnassigned(Variable variable) {
1433-
VariableModel<Variable, Type> info = variableInfo[variable];
1434-
if (info == null) return;
1435-
1436-
VariableModel<Variable, Type> newInfo = info.markNotUnassigned();
1437-
if (identical(newInfo, info)) return;
1438-
1439-
(newVariableInfo ??=
1440-
new Map<Variable, VariableModel<Variable, Type>>.from(
1441-
variableInfo))[variable] = newInfo;
1442-
}
1443-
1444-
for (Variable variable in other.variableInfo.keys) {
1445-
VariableModel<Variable, Type> otherInfo = other.variableInfo[variable];
1446-
if (!otherInfo.unassigned) {
1447-
markNotUnassigned(variable);
1448-
}
1449-
}
1450-
1451-
if (newVariableInfo == null) return this;
1452-
1453-
return new FlowModel<Variable, Type>.withInfo(reachable, newVariableInfo);
1454-
}
1455-
14561426
/// Updates the state to reflect a control path that is known to have
14571427
/// previously passed through some [other] state.
14581428
///
@@ -2117,15 +2087,6 @@ class VariableModel<Variable, Type> {
21172087
null, const [], true, false, writeCaptured);
21182088
}
21192089

2120-
/// Returns a new [VariableModel] reflecting the fact that the variable is
2121-
/// not definitely unassigned.
2122-
VariableModel<Variable, Type> markNotUnassigned() {
2123-
if (!unassigned) return this;
2124-
2125-
return new VariableModel<Variable, Type>(
2126-
promotedTypes, tested, assigned, false, writeCaptured);
2127-
}
2128-
21292090
/// Returns an updated model reflect a control path that is known to have
21302091
/// previously passed through some [other] state. See [FlowModel.restrict]
21312092
/// for details.

pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,68 +2674,6 @@ main() {
26742674
});
26752675
});
26762676

2677-
group('joinUnassigned', () {
2678-
group('other', () {
2679-
test('unchanged', () {
2680-
var h = Harness();
2681-
2682-
var a = Var('a', 'int');
2683-
var b = Var('b', 'int');
2684-
2685-
var s1 = FlowModel<Var, Type>(Reachability.initial)
2686-
.declare(a, false)
2687-
.declare(b, false)
2688-
.write(a, Type('int'), h);
2689-
expect(s1.variableInfo, {
2690-
a: _matchVariableModel(assigned: true, unassigned: false),
2691-
b: _matchVariableModel(assigned: false, unassigned: true),
2692-
});
2693-
2694-
var s2 = s1.write(a, Type('int'), h);
2695-
expect(s2.variableInfo, {
2696-
a: _matchVariableModel(assigned: true, unassigned: false),
2697-
b: _matchVariableModel(assigned: false, unassigned: true),
2698-
});
2699-
2700-
var s3 = s1.joinUnassigned(s2);
2701-
expect(s3, same(s1));
2702-
});
2703-
2704-
test('changed', () {
2705-
var h = Harness();
2706-
2707-
var a = Var('a', 'int');
2708-
var b = Var('b', 'int');
2709-
var c = Var('c', 'int');
2710-
2711-
var s1 = FlowModel<Var, Type>(Reachability.initial)
2712-
.declare(a, false)
2713-
.declare(b, false)
2714-
.declare(c, false)
2715-
.write(a, Type('int'), h);
2716-
expect(s1.variableInfo, {
2717-
a: _matchVariableModel(assigned: true, unassigned: false),
2718-
b: _matchVariableModel(assigned: false, unassigned: true),
2719-
c: _matchVariableModel(assigned: false, unassigned: true),
2720-
});
2721-
2722-
var s2 = s1.write(b, Type('int'), h);
2723-
expect(s2.variableInfo, {
2724-
a: _matchVariableModel(assigned: true, unassigned: false),
2725-
b: _matchVariableModel(assigned: true, unassigned: false),
2726-
c: _matchVariableModel(assigned: false, unassigned: true),
2727-
});
2728-
2729-
var s3 = s1.joinUnassigned(s2);
2730-
expect(s3.variableInfo, {
2731-
a: _matchVariableModel(assigned: true, unassigned: false),
2732-
b: _matchVariableModel(assigned: false, unassigned: false),
2733-
c: _matchVariableModel(assigned: false, unassigned: true),
2734-
});
2735-
});
2736-
});
2737-
});
2738-
27392677
group('conservativeJoin', () {
27402678
test('unchanged', () {
27412679
var h = Harness();

0 commit comments

Comments
 (0)