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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 21242002: Retain elements a finer granularity than library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 7 years, 4 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
Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
index 9dd9ab58701c4a58cc784c1425ab6979c6462d09..88d35c5b5e09c04ad7913bb54136a2fed13d1890 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -329,6 +329,9 @@ abstract class Compiler implements DiagnosticListener {
*/
final String globalJsName;
+ /// Emit terse diagnostics without howToFix.
+ final bool terseDiagnostics;
+
final api.CompilerOutputProvider outputProvider;
bool disableInlining = false;
@@ -385,6 +388,9 @@ abstract class Compiler implements DiagnosticListener {
// Initialized when symbolImplementationClass has been resolved.
FunctionElement symbolValidatedConstructor;
+ // Initialized when mirrorsUsedClass has been resolved.
+ FunctionElement mirrorsUsedConstructor;
+
// Initialized when dart:mirrors is loaded.
ClassElement deferredLibraryClass;
@@ -521,6 +527,7 @@ abstract class Compiler implements DiagnosticListener {
this.sourceMapUri: null,
this.buildId: UNDETERMINED_BUILD_ID,
this.globalJsName: r'$',
+ this.terseDiagnostics: false,
outputProvider,
List<String> strips: const []})
: this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly,
@@ -742,6 +749,8 @@ abstract class Compiler implements DiagnosticListener {
} else if (symbolImplementationClass == cls) {
symbolValidatedConstructor = symbolImplementationClass.lookupConstructor(
symbolValidatedConstructorSelector);
+ } else if (mirrorsUsedClass == cls) {
+ mirrorsUsedConstructor = cls.constructors.head;
}
}
@@ -797,7 +806,9 @@ abstract class Compiler implements DiagnosticListener {
'$missingHelperClasses');
}
- types = new Types(this, dynamicClass);
+ if (types == null) {
+ types = new Types(this, dynamicClass);
+ }
backend.initializeHelperClasses();
dynamicClass.ensureResolved(this);
@@ -1167,7 +1178,7 @@ abstract class Compiler implements DiagnosticListener {
MessageKind errorCode,
[Map arguments = const {}]) {
reportMessage(spanFromSpannable(node),
- errorCode.error(arguments),
+ errorCode.error(arguments, terseDiagnostics),
api.Diagnostic.ERROR);
}
@@ -1183,21 +1194,21 @@ abstract class Compiler implements DiagnosticListener {
void reportWarningCode(Spannable node, MessageKind errorCode,
[Map arguments = const {}]) {
reportMessage(spanFromSpannable(node),
- errorCode.error(arguments),
+ errorCode.error(arguments, terseDiagnostics),
api.Diagnostic.WARNING);
}
void reportInfo(Spannable node, MessageKind errorCode,
[Map arguments = const {}]) {
reportMessage(spanFromSpannable(node),
- errorCode.error(arguments),
+ errorCode.error(arguments, terseDiagnostics),
api.Diagnostic.INFO);
}
void reportHint(Spannable node, MessageKind errorCode,
[Map arguments = const {}]) {
reportMessage(spanFromSpannable(node),
- errorCode.error(arguments),
+ errorCode.error(arguments, terseDiagnostics),
api.Diagnostic.HINT);
}

Powered by Google App Engine
This is Rietveld 408576698