[vm] Reland the flag flip behind the --nnbd build flag

Bug: https://github.com/dart-lang/sdk/issues/40409
Bug: https://github.com/dart-lang/sdk/issues/40179
Change-Id: Ib84926ef15068d23dcac7b89843c454b8446b28e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134062
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
This commit is contained in:
Liam Appelbe 2020-01-30 23:41:19 +00:00 committed by commit-bot@chromium.org
parent d550879d9d
commit 00e481aab0
2 changed files with 13 additions and 1 deletions

View file

@ -140,6 +140,10 @@ config("dart_config") {
}
}
if (use_nnbd) {
defines += [ "DART_BUILT_WITH_NNBD_FLAG" ]
}
if (!is_win) {
cflags = [
"-Werror",

View file

@ -123,8 +123,16 @@ class Dart : public AllStatic {
static Dart_EntropySource entropy_source_callback() {
return entropy_source_callback_;
}
// TODO(dartbug.com/40342): Delete these functions.
static void set_non_nullable_flag(bool value) { non_nullable_flag_ = value; }
static bool non_nullable_flag() { return non_nullable_flag_; }
static bool non_nullable_flag() {
#ifdef DART_BUILT_WITH_NNBD_FLAG
return true;
#else
return non_nullable_flag_;
#endif
}
private:
static void WaitForIsolateShutdown();