Skip to content

Commit

Permalink
[cfe] Remove unused properties from BodyBuilderContext
Browse files Browse the repository at this point in the history
Change-Id: I75f6a3cdf63b32555ae96f181f99bfaec1de5e56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391403
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
  • Loading branch information
johnniwinther authored and Commit Queue committed Oct 23, 2024
1 parent a3085e7 commit f46aa56
Show file tree
Hide file tree
Showing 27 changed files with 118 additions and 537 deletions.
5 changes: 1 addition & 4 deletions pkg/front_end/lib/src/base/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,7 @@ mixin ErroneousMemberBuilderMixin implements SourceMemberBuilder {
}

@override
BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields}) {
BodyBuilderContext createBodyBuilderContext() {
throw new UnsupportedError(
'$runtimeType.bodyBuilderContextForAnnotations}');
}
Expand Down
7 changes: 2 additions & 5 deletions pkg/front_end/lib/src/builder/formal_parameter_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,8 @@ class FormalParameterBuilder extends BuilderImpl
final DeclarationBuilder declarationBuilder =
parent.declarationBuilder!;
LookupScope scope = declarationBuilder.scope;
BodyBuilderContext bodyBuilderContext = new ParameterBodyBuilderContext(
this,
inOutlineBuildingPhase: true,
inMetadata: false,
inConstFields: false);
BodyBuilderContext bodyBuilderContext =
new ParameterBodyBuilderContext(this);
BodyBuilder bodyBuilder = libraryBuilder.loader
.createBodyBuilderForOutlineExpression(
libraryBuilder, bodyBuilderContext, scope, fileUri);
Expand Down
10 changes: 2 additions & 8 deletions pkg/front_end/lib/src/fragment/constructor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,8 @@ class _ConstructorBodyBuildingContext implements FunctionBodyBuildingContext {
}

@override
BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields}) {
return _fragment.builder.createBodyBuilderContext(
inOutlineBuildingPhase: inOutlineBuildingPhase,
inMetadata: inMetadata,
inConstFields: inConstFields);
BodyBuilderContext createBodyBuilderContext() {
return _fragment.builder.createBodyBuilderContext();
}

@override
Expand Down
10 changes: 2 additions & 8 deletions pkg/front_end/lib/src/fragment/factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,8 @@ class _FactoryBodyBuildingContext implements FunctionBodyBuildingContext {
}

@override
BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields}) {
return _fragment.builder.createBodyBuilderContext(
inOutlineBuildingPhase: inOutlineBuildingPhase,
inMetadata: inMetadata,
inConstFields: inConstFields);
BodyBuilderContext createBodyBuilderContext() {
return _fragment.builder.createBodyBuilderContext();
}

@override
Expand Down
5 changes: 1 addition & 4 deletions pkg/front_end/lib/src/fragment/function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ abstract class FunctionBodyBuildingContext {
// TODO(johnniwinther): Avoid the need for this.
bool get shouldBuild;

BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields});
BodyBuilderContext createBodyBuilderContext();

LookupScope get typeParameterScope;

Expand Down
10 changes: 2 additions & 8 deletions pkg/front_end/lib/src/fragment/getter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,8 @@ class _GetterBodyBuildingContext implements FunctionBodyBuildingContext {
}

@override
BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields}) {
return _fragment.builder.createBodyBuilderContext(
inOutlineBuildingPhase: inOutlineBuildingPhase,
inMetadata: inMetadata,
inConstFields: inConstFields);
BodyBuilderContext createBodyBuilderContext() {
return _fragment.builder.createBodyBuilderContext();
}

@override
Expand Down
10 changes: 2 additions & 8 deletions pkg/front_end/lib/src/fragment/method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,8 @@ class _MethodBodyBuildingContext implements FunctionBodyBuildingContext {
}

@override
BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields}) {
return _fragment.builder.createBodyBuilderContext(
inOutlineBuildingPhase: inOutlineBuildingPhase,
inMetadata: inMetadata,
inConstFields: inConstFields);
BodyBuilderContext createBodyBuilderContext() {
return _fragment.builder.createBodyBuilderContext();
}

@override
Expand Down
10 changes: 2 additions & 8 deletions pkg/front_end/lib/src/fragment/primary_constructor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,8 @@ class _PrimaryConstructorBodyBuildingContext
}

@override
BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields}) {
return _fragment.builder.createBodyBuilderContext(
inOutlineBuildingPhase: inOutlineBuildingPhase,
inMetadata: inMetadata,
inConstFields: inConstFields);
BodyBuilderContext createBodyBuilderContext() {
return _fragment.builder.createBodyBuilderContext();
}

@override
Expand Down
10 changes: 2 additions & 8 deletions pkg/front_end/lib/src/fragment/setter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,8 @@ class _SetterBodyBuildingContext implements FunctionBodyBuildingContext {
}

@override
BodyBuilderContext createBodyBuilderContext(
{required bool inOutlineBuildingPhase,
required bool inMetadata,
required bool inConstFields}) {
return _fragment.builder.createBodyBuilderContext(
inOutlineBuildingPhase: inOutlineBuildingPhase,
inMetadata: inMetadata,
inConstFields: inConstFields);
BodyBuilderContext createBodyBuilderContext() {
return _fragment.builder.createBodyBuilderContext();
}

@override
Expand Down
Loading

0 comments on commit f46aa56

Please sign in to comment.