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

Unified Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 1619253003: Include explicit constructors and static methods into UnlinkedPublicName (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
Index: pkg/analyzer/lib/src/summary/format.dart
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index a089ba2678043df22bc3fb390090722b327b0413..cf764c245466579131546266a13d10e5ddbdcd83 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -21,6 +21,16 @@ enum ReferenceKind {
classOrEnum,
/**
+ * The entity is a constructor.
+ */
+ constructor,
+
+ /**
+ * The entity is a static method.
+ */
+ staticMethod,
+
+ /**
* The entity is a typedef.
*/
typedef,
@@ -4293,6 +4303,7 @@ class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp
String _name;
ReferenceKind _kind;
int _numTypeParameters;
+ List<UnlinkedPublicNameBuilder> _executables;
@override
String get name => _name ??= '';
@@ -4329,18 +4340,35 @@ class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp
_numTypeParameters = _value;
}
- UnlinkedPublicNameBuilder({String name, ReferenceKind kind, int numTypeParameters})
+ @override
+ List<UnlinkedPublicNameBuilder> get executables => _executables ??= <UnlinkedPublicNameBuilder>[];
+
+ /**
+ * If this [UnlinkedPublicName] is a class, the list of static methods
+ * and constructors. Otherwise empty.
+ */
+ void set executables(List<UnlinkedPublicNameBuilder> _value) {
+ assert(!_finished);
+ _executables = _value;
+ }
+
+ UnlinkedPublicNameBuilder({String name, ReferenceKind kind, int numTypeParameters, List<UnlinkedPublicNameBuilder> executables})
: _name = name,
_kind = kind,
- _numTypeParameters = numTypeParameters;
+ _numTypeParameters = numTypeParameters,
+ _executables = executables;
fb.Offset finish(fb.Builder fbBuilder) {
assert(!_finished);
_finished = true;
fb.Offset offset_name;
+ fb.Offset offset_executables;
if (_name != null) {
offset_name = fbBuilder.writeString(_name);
}
+ if (!(_executables == null || _executables.isEmpty)) {
+ offset_executables = fbBuilder.writeList(_executables.map((b) => b.finish(fbBuilder)).toList());
+ }
fbBuilder.startTable();
if (offset_name != null) {
fbBuilder.addOffset(0, offset_name);
@@ -4351,6 +4379,9 @@ class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp
if (_numTypeParameters != null && _numTypeParameters != 0) {
fbBuilder.addUint32(2, _numTypeParameters);
}
+ if (offset_executables != null) {
+ fbBuilder.addOffset(3, offset_executables);
+ }
return fbBuilder.endTable();
}
}
@@ -4362,9 +4393,6 @@ class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp
* TODO(paulberry): add a count of generic parameters, so that resynthesis
* doesn't have to peek into the library to obtain this info.
*
- * TODO(paulberry): for classes, add info about static members and
- * constructors, since this will be needed to prelink info about constants.
- *
* TODO(paulberry): some of this information is redundant with information
* elsewhere in the summary. Consider reducing the redundancy to reduce
* summary size.
@@ -4386,6 +4414,12 @@ abstract class UnlinkedPublicName extends base.SummaryClass {
* it accepts. Otherwise zero.
*/
int get numTypeParameters;
+
+ /**
+ * If this [UnlinkedPublicName] is a class, the list of static methods
+ * and constructors. Otherwise empty.
+ */
+ List<UnlinkedPublicName> get executables;
}
class _UnlinkedPublicNameReader extends fb.TableReader<_UnlinkedPublicNameImpl> {
@@ -4403,6 +4437,7 @@ class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin imple
String _name;
ReferenceKind _kind;
int _numTypeParameters;
+ List<UnlinkedPublicName> _executables;
@override
String get name {
@@ -4421,6 +4456,12 @@ class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin imple
_numTypeParameters ??= const fb.Uint32Reader().vTableGet(_bp, 2, 0);
return _numTypeParameters;
}
+
+ @override
+ List<UnlinkedPublicName> get executables {
+ _executables ??= const fb.ListReader<UnlinkedPublicName>(const _UnlinkedPublicNameReader()).vTableGet(_bp, 3, const <UnlinkedPublicName>[]);
+ return _executables;
+ }
}
abstract class _UnlinkedPublicNameMixin implements UnlinkedPublicName {
@@ -4429,6 +4470,7 @@ abstract class _UnlinkedPublicNameMixin implements UnlinkedPublicName {
"name": name,
"kind": kind,
"numTypeParameters": numTypeParameters,
+ "executables": executables,
};
}

Powered by Google App Engine
This is Rietveld 408576698