[cfe] Add a bit to Library to inticate if it's opted in for NNBD

Closes #37682.

Bug: http://dartbug.com/37682.
Change-Id: Ibe21cd0a1eac25a2883d2e2241d7476ca627edba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114857
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This commit is contained in:
Dmitry Stefantsov
2019-09-12 12:15:56 +00:00
committed by commit-bot@chromium.org
parent a350f6e57d
commit bdf237fa77
5 changed files with 12 additions and 4 deletions
+2 -2
View File
@@ -143,7 +143,7 @@ type CanonicalName {
type ComponentFile {
UInt32 magic = 0x90ABCDEF;
UInt32 formatVersion = 31;
UInt32 formatVersion = 32;
List<String> problemsAsJson; // Described in problems.md.
Library[] libraries;
UriSource sourceMap;
@@ -228,7 +228,7 @@ type Name {
}
type Library {
Byte flags (isExternal, isSynthetic);
Byte flags (isExternal, isSynthetic, isNonNullableOptedIn);
UInt languageVersionMajor;
UInt languageVersionMinor;
CanonicalNameReference canonicalName;
+8
View File
@@ -330,6 +330,7 @@ class Library extends NamedNode
static const int ExternalFlag = 1 << 0;
static const int SyntheticFlag = 1 << 1;
static const int NonNullableOptedInFlag = 1 << 2;
int flags = 0;
@@ -354,6 +355,13 @@ class Library extends NamedNode
flags = value ? (flags | SyntheticFlag) : (flags & ~SyntheticFlag);
}
bool get isNonNullableOptedIn => (flags & NonNullableOptedInFlag) != 0;
void set isNonNullableOptedIn(bool value) {
flags = value
? (flags | NonNullableOptedInFlag)
: (flags & ~NonNullableOptedInFlag);
}
String name;
/// Problems in this [Library] encoded as json objects.
+1 -1
View File
@@ -146,7 +146,7 @@ class Tag {
/// Internal version of kernel binary format.
/// Bump it when making incompatible changes in kernel binaries.
/// Keep in sync with runtime/vm/kernel_binary.h, pkg/kernel/binary.md.
static const int BinaryFormatVersion = 31;
static const int BinaryFormatVersion = 32;
}
abstract class ConstantTag {
+1 -1
View File
@@ -20,7 +20,7 @@ static const uint32_t kMagicProgramFile = 0x90ABCDEFu;
// Both version numbers are inclusive.
static const uint32_t kMinSupportedKernelFormatVersion = 18;
static const uint32_t kMaxSupportedKernelFormatVersion = 31;
static const uint32_t kMaxSupportedKernelFormatVersion = 32;
// Keep in sync with package:kernel/lib/binary/tag.dart
#define KERNEL_TAG_LIST(V) \