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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1363993004: Report info messages together with their error, warning, or hint. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 3 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/elements/modelx.dart ('k') | pkg/compiler/lib/src/js_backend/js_backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 20e7bb7fdf839aa6d1a6b64885a4506485bc8aec..21bcb938c917ebfaaaec2926563f723dcd7114bb 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -902,7 +902,7 @@ class JavaScriptBackend extends Backend {
cls.ensureResolved(compiler);
cls.forEachMember((ClassElement classElement, Element member) {
if (member.name == Identifiers.call) {
- compiler.reportError(
+ compiler.reportErrorMessage(
member,
MessageKind.CALL_NOT_SUPPORTED_ON_NATIVE_CLASS);
return;
@@ -1514,11 +1514,13 @@ class JavaScriptBackend extends Backend {
if (totalMethodCount != preMirrorsMethodCount) {
int mirrorCount = totalMethodCount - preMirrorsMethodCount;
double percentage = (mirrorCount / totalMethodCount) * 100;
- compiler.reportHint(
+ DiagnosticMessage hint = compiler.createMessage(
compiler.mainApp, MessageKind.MIRROR_BLOAT,
{'count': mirrorCount,
'total': totalMethodCount,
'percentage': percentage.round()});
+
+ List<DiagnosticMessage> infos = <DiagnosticMessage>[];
for (LibraryElement library in compiler.libraryLoader.libraries) {
if (library.isInternalLibrary) continue;
for (ImportElement import in library.imports) {
@@ -1529,10 +1531,11 @@ class JavaScriptBackend extends Backend {
? MessageKind.MIRROR_IMPORT
: MessageKind.MIRROR_IMPORT_NO_USAGE;
compiler.withCurrentElement(library, () {
- compiler.reportInfo(import, kind);
+ infos.add(compiler.createMessage(import, kind));
});
}
}
+ compiler.reportHint(hint, infos);
}
return programSize;
}
@@ -2634,7 +2637,8 @@ class JavaScriptBackend extends Backend {
if (cls == forceInlineClass) {
hasForceInline = true;
if (VERBOSE_OPTIMIZER_HINTS) {
- compiler.reportHint(element,
+ compiler.reportHintMessage(
+ element,
MessageKind.GENERIC,
{'text': "Must inline"});
}
@@ -2642,7 +2646,8 @@ class JavaScriptBackend extends Backend {
} else if (cls == noInlineClass) {
hasNoInline = true;
if (VERBOSE_OPTIMIZER_HINTS) {
- compiler.reportHint(element,
+ compiler.reportHintMessage(
+ element,
MessageKind.GENERIC,
{'text': "Cannot inline"});
}
@@ -2655,7 +2660,8 @@ class JavaScriptBackend extends Backend {
" or static functions");
}
if (VERBOSE_OPTIMIZER_HINTS) {
- compiler.reportHint(element,
+ compiler.reportHintMessage(
+ element,
MessageKind.GENERIC,
{'text': "Cannot throw"});
}
@@ -2663,7 +2669,8 @@ class JavaScriptBackend extends Backend {
} else if (cls == noSideEffectsClass) {
hasNoSideEffects = true;
if (VERBOSE_OPTIMIZER_HINTS) {
- compiler.reportHint(element,
+ compiler.reportHintMessage(
+ element,
MessageKind.GENERIC,
{'text': "Has no side effects"});
}
@@ -2769,7 +2776,7 @@ class JavaScriptBackend extends Backend {
@override
bool enableCodegenWithErrorsIfSupported(Spannable node) {
if (compiler.useCpsIr) {
- compiler.reportHint(
+ compiler.reportHintMessage(
node,
MessageKind.GENERIC,
{'text': "Generation of code with compile time errors is currently "
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | pkg/compiler/lib/src/js_backend/js_backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698