| Index: pkg/compiler/lib/src/ssa/graph_builder.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/graph_builder.dart b/pkg/compiler/lib/src/ssa/graph_builder.dart
|
| index 9da63208c2044172a5841a8c2d695b884f1eb75e..969899f617e6e1032d0ca4031d2e56906a95b95d 100644
|
| --- a/pkg/compiler/lib/src/ssa/graph_builder.dart
|
| +++ b/pkg/compiler/lib/src/ssa/graph_builder.dart
|
| @@ -2,6 +2,8 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| +import '../elements/elements.dart';
|
| +import '../types/types.dart';
|
| import 'nodes.dart';
|
|
|
| /// Base class for objects that build up an SSA graph.
|
| @@ -35,6 +37,11 @@ abstract class GraphBuilder {
|
| /// [isAborted].
|
| bool isReachable = true;
|
|
|
| + HParameterValue lastAddedParameter;
|
| +
|
| + Map<ParameterElement, HInstruction> parameters =
|
| + <ParameterElement, HInstruction>{};
|
| +
|
| HBasicBlock addNewBlock() {
|
| HBasicBlock block = graph.addNewBlock();
|
| // If adding a new block during building of an expression, it is due to
|
| @@ -84,4 +91,15 @@ abstract class GraphBuilder {
|
| void add(HInstruction instruction) {
|
| current.add(instruction);
|
| }
|
| +
|
| + HParameterValue addParameter(Entity parameter, TypeMask type) {
|
| + HParameterValue result = new HParameterValue(parameter, type);
|
| + if (lastAddedParameter == null) {
|
| + graph.entry.addBefore(graph.entry.first, result);
|
| + } else {
|
| + graph.entry.addAfter(lastAddedParameter, result);
|
| + }
|
| + lastAddedParameter = result;
|
| + return result;
|
| + }
|
| }
|
|
|