Added flag --suppress_cfe_warnings to suppress warnings generated by the common front end. Fixes issue #31552.

Bug:
Change-Id: Ia025fa2feaec20cbada1596fb022b70e69501ede
Reviewed-on: https://dart-review.googlesource.com/30385
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Ben Konyi 2017-12-20 19:01:02 +00:00 committed by commit-bot@chromium.org
parent 12086506f8
commit c8ae685d0c
2 changed files with 15 additions and 2 deletions

View file

@ -185,6 +185,8 @@ Future _processLoadRequest(request) async {
final bool strong = request[5];
final int isolateId = request[6];
final List sourceFiles = request[7];
// TODO(bkonyi): this still needs to be hooked in.
// final bool suppressWarnings = request[8];
Compiler compiler;
// TODO(aam): There should be no need to have an option to choose
@ -284,7 +286,8 @@ train(String scriptUri, String platformKernel) {
false /* incremental */,
false /* strong */,
1 /* isolateId chosen randomly */,
null /* source files */
null /* source files */,
false /* suppress warnings */,
];
_processLoadRequest(request);
}

View file

@ -34,6 +34,10 @@ DEFINE_FLAG(bool,
show_kernel_isolate,
false,
"Show Kernel service isolate as normal isolate.");
DEFINE_FLAG(bool,
suppress_fe_warnings,
false,
"Suppress warnings from the FE.");
const char* KernelIsolate::kName = DART_KERNEL_ISOLATE_NAME;
Dart_IsolateCreateCallback KernelIsolate::create_callback_ = NULL;
@ -361,6 +365,11 @@ class KernelCompilationRequest : public ValueObject {
} else {
files.type = Dart_CObject_kNull;
}
Dart_CObject suppress_warnings;
suppress_warnings.type = Dart_CObject_kBool;
suppress_warnings.value.as_bool = FLAG_suppress_fe_warnings;
Dart_CObject* message_arr[] = {&tag,
&send_port,
&uri,
@ -368,7 +377,8 @@ class KernelCompilationRequest : public ValueObject {
&dart_incremental,
&dart_strong,
&isolate_id,
&files};
&files,
&suppress_warnings};
message.value.as_array.values = message_arr;
message.value.as_array.length = ARRAY_SIZE(message_arr);
// Send the message.