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

Unified Diff: pkg/kernel/lib/binary/ast_to_binary.dart

Issue 2988113002: Add Class.isEnum to Kernel and use it to resynthesize enums in Analyzer. (Closed)
Patch Set: Created 3 years, 5 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/kernel/lib/binary/ast_from_binary.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/binary/ast_to_binary.dart
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index 16d7f0cc8c9bf01c6e6b3918f0130da4936a5477..e1d3817fab3736b56af3d7972668f7cdd6654081 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -363,18 +363,22 @@ class BinaryPrinter extends Visitor {
writeList(annotations, writeAnnotation);
}
- int _encodeClassFlags(
- bool isAbstract, bool isSyntheticMixinImplementation, ClassLevel level) {
+ int _encodeClassFlags(bool isAbstract, bool isEnum,
+ bool isSyntheticMixinImplementation, ClassLevel level) {
int abstractFlag = isAbstract ? 1 : 0;
+ int isEnumFlag = isSyntheticMixinImplementation ? 2 : 0;
int isSyntheticMixinImplementationFlag =
- isSyntheticMixinImplementation ? 2 : 0;
- int levelFlags = (level.index - 1) << 2;
- return abstractFlag | isSyntheticMixinImplementationFlag | levelFlags;
+ isSyntheticMixinImplementation ? 4 : 0;
+ int levelFlags = (level.index - 1) << 3;
+ return abstractFlag |
+ isEnumFlag |
+ isSyntheticMixinImplementationFlag |
+ levelFlags;
}
visitClass(Class node) {
- int flags = _encodeClassFlags(
- node.isAbstract, node.isSyntheticMixinImplementation, node.level);
+ int flags = _encodeClassFlags(node.isAbstract, node.isEnum,
+ node.isSyntheticMixinImplementation, node.level);
if (node.canonicalName == null) {
throw 'Missing canonical name for $node';
}
« no previous file with comments | « pkg/kernel/lib/binary/ast_from_binary.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698