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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/cps_ir/scalar_replacement.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 86f968d68215c4c56d7a56dd22ed9dde518c3269..3d168d3850d868714ad0ccf634e1798151171ee9 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -15,6 +15,8 @@ import '../compiler.dart' show
Compiler;
import '../constants/expressions.dart';
import '../dart_types.dart';
+import '../diagnostics/diagnostic_listener.dart' show
+ DiagnosticReporter;
import '../diagnostics/invariant.dart' show
invariant;
import '../elements/elements.dart';
@@ -83,7 +85,7 @@ class IrBuilderTask extends CompilerTask {
TreeElements elementsMapping = element.resolvedAst.elements;
element = element.implementation;
- return compiler.withCurrentElement(element, () {
+ return reporter.withCurrentElement(element, () {
SourceInformationBuilder sourceInformationBuilder =
sourceInformationStrategy.createBuilderForContext(element);
@@ -160,6 +162,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
this.compiler,
this.sourceInformationBuilder);
+ DiagnosticReporter get reporter => compiler.reporter;
+
String bailoutMessage = null;
@override
@@ -235,14 +239,14 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
ir.Primitive visitBreakStatement(ast.BreakStatement node) {
if (!irBuilder.buildBreak(elements.getTargetOf(node))) {
- compiler.internalError(node, "'break' target not found");
+ reporter.internalError(node, "'break' target not found");
}
return null;
}
ir.Primitive visitContinueStatement(ast.ContinueStatement node) {
if (!irBuilder.buildContinue(elements.getTargetOf(node))) {
- compiler.internalError(node, "'continue' target not found");
+ reporter.internalError(node, "'continue' target not found");
}
return null;
}
@@ -2258,7 +2262,7 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
}
internalError(ast.Node node, String message) {
- compiler.internalError(node, message);
+ reporter.internalError(node, message);
}
@override
@@ -2646,7 +2650,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
break;
default:
- compiler.internalError(element, "Unexpected element type $element");
+ reporter.internalError(element, "Unexpected element type $element");
}
return root;
});
@@ -2905,7 +2909,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
fieldValues);
hasConstructorCall = true;
} else {
- compiler.internalError(initializer,
+ reporter.internalError(initializer,
"Unexpected initializer type $initializer");
}
}
@@ -2915,7 +2919,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
ClassElement superClass = enclosingClass.superclass;
FunctionElement target = superClass.lookupDefaultConstructor();
if (target == null) {
- compiler.internalError(superClass, "No default constructor available.");
+ reporter.internalError(superClass, "No default constructor available.");
}
target = target.implementation;
evaluateConstructorCallFromInitializer(
@@ -3371,7 +3375,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
CallStructure callStructure) {
Element element = backend.isolateHelperLibrary.find(helperName);
if (element == null) {
- compiler.internalError(node,
+ reporter.internalError(node,
'Isolate library and compiler mismatch.');
}
List<ir.Primitive> arguments = translateStaticArguments(argumentList,
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/cps_ir/scalar_replacement.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698