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

Unified Diff: pkg/compiler/lib/src/dart_backend/backend.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/cps_ir/type_propagation.dart ('k') | pkg/compiler/lib/src/dart_backend/outputter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart_backend/backend.dart
diff --git a/pkg/compiler/lib/src/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart
index 2f81597fbc8575a2b4c9a7e34439b4432da2abac..c2057a711413413b0db3a5bcb49a2465657edab9 100644
--- a/pkg/compiler/lib/src/dart_backend/backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend.dart
@@ -52,7 +52,7 @@ class DartBackend extends Backend {
new Set<ClassElement>();
bool enableCodegenWithErrorsIfSupported(Spannable node) {
- compiler.reportHintMessage(
+ reporter.reportHintMessage(
node,
MessageKind.GENERIC,
{'text': "Generation of code with compile time errors is not "
@@ -108,7 +108,7 @@ class DartBackend extends Backend {
stripAsserts = strips.indexOf('asserts') != -1,
constantCompilerTask = new DartConstantTask(compiler),
outputter = new DartOutputter(
- compiler, compiler.outputProvider,
+ compiler.reporter, compiler.outputProvider,
forceStripTypes: strips.indexOf('types') != -1,
multiFile: multiFile,
enableMinification: compiler.enableMinification),
@@ -116,6 +116,9 @@ class DartBackend extends Backend {
resolutionCallbacks = new DartResolutionCallbacks(this);
}
+
+ DiagnosticReporter get reporter => compiler.reporter;
+
Resolution get resolution => compiler.resolution;
bool classNeedsRti(ClassElement cls) => false;
@@ -169,7 +172,7 @@ class DartBackend extends Backend {
newTypedefElementCallback,
newClassElementCallback) {
ReferencedElementCollector collector =
- new ReferencedElementCollector(compiler,
+ new ReferencedElementCollector(reporter,
element,
elementAst,
newTypedefElementCallback,
@@ -216,7 +219,7 @@ class DartBackend extends Backend {
'Output total size: $totalOutputSize bytes (${percentage}%)');
}
- log(String message) => compiler.log('[DartBackend] $message');
+ log(String message) => reporter.log('[DartBackend] $message');
@override
Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
@@ -332,7 +335,7 @@ class DartBackend extends Backend {
@override
bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) {
// TODO(sigurdm): Implement deferred loading for dart2dart.
- compiler.reportWarningMessage(
+ reporter.reportWarningMessage(
node, MessageKind.DEFERRED_LIBRARY_DART_2_DART);
return false;
}
@@ -387,13 +390,13 @@ class EmitterUnparser extends Unparser {
* (just to name a few). Retraverse AST to pick those up.
*/
class ReferencedElementCollector extends Visitor {
- final Compiler compiler;
+ final DiagnosticReporter reporter;
final Element element;
final ElementAst elementAst;
final newTypedefElementCallback;
final newClassElementCallback;
- ReferencedElementCollector(this.compiler,
+ ReferencedElementCollector(this.reporter,
this.element,
this.elementAst,
this.newTypedefElementCallback,
@@ -414,7 +417,7 @@ class ReferencedElementCollector extends Visitor {
}
void collect() {
- compiler.withCurrentElement(element, () {
+ reporter.withCurrentElement(element, () {
elementAst.ast.accept(this);
});
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | pkg/compiler/lib/src/dart_backend/outputter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698