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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files".
7 7
8 library analyzer.src.summary.format; 8 library analyzer.src.summary.format;
9 9
10 import 'base.dart' as base; 10 import 'base.dart' as base;
11 import 'flat_buffers.dart' as fb; 11 import 'flat_buffers.dart' as fb;
12 12
13 /** 13 /**
14 * Enum used to indicate the kind of entity referred to by a 14 * Enum used to indicate the kind of entity referred to by a
15 * [LinkedReference]. 15 * [LinkedReference].
16 */ 16 */
17 enum ReferenceKind { 17 enum ReferenceKind {
18 /** 18 /**
19 * The entity is a class or enum. 19 * The entity is a class or enum.
20 */ 20 */
21 classOrEnum, 21 classOrEnum,
22 22
23 /** 23 /**
24 * The entity is a constructor.
25 */
26 constructor,
27
28 /**
29 * The entity is a static method.
30 */
31 staticMethod,
32
33 /**
24 * The entity is a typedef. 34 * The entity is a typedef.
25 */ 35 */
26 typedef, 36 typedef,
27 37
28 /** 38 /**
29 * The entity is a top level function. 39 * The entity is a top level function.
30 */ 40 */
31 topLevelFunction, 41 topLevelFunction,
32 42
33 /** 43 /**
(...skipping 4252 matching lines...) Expand 10 before | Expand all | Expand 10 after
4286 "uriEnd": uriEnd, 4296 "uriEnd": uriEnd,
4287 }; 4297 };
4288 } 4298 }
4289 4299
4290 class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp lements UnlinkedPublicName { 4300 class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp lements UnlinkedPublicName {
4291 bool _finished = false; 4301 bool _finished = false;
4292 4302
4293 String _name; 4303 String _name;
4294 ReferenceKind _kind; 4304 ReferenceKind _kind;
4295 int _numTypeParameters; 4305 int _numTypeParameters;
4306 List<UnlinkedPublicNameBuilder> _executables;
4296 4307
4297 @override 4308 @override
4298 String get name => _name ??= ''; 4309 String get name => _name ??= '';
4299 4310
4300 /** 4311 /**
4301 * The name itself. 4312 * The name itself.
4302 */ 4313 */
4303 void set name(String _value) { 4314 void set name(String _value) {
4304 assert(!_finished); 4315 assert(!_finished);
4305 _name = _value; 4316 _name = _value;
(...skipping 16 matching lines...) Expand all
4322 /** 4333 /**
4323 * If the entity being referred to is generic, the number of type parameters 4334 * If the entity being referred to is generic, the number of type parameters
4324 * it accepts. Otherwise zero. 4335 * it accepts. Otherwise zero.
4325 */ 4336 */
4326 void set numTypeParameters(int _value) { 4337 void set numTypeParameters(int _value) {
4327 assert(!_finished); 4338 assert(!_finished);
4328 assert(_value == null || _value >= 0); 4339 assert(_value == null || _value >= 0);
4329 _numTypeParameters = _value; 4340 _numTypeParameters = _value;
4330 } 4341 }
4331 4342
4332 UnlinkedPublicNameBuilder({String name, ReferenceKind kind, int numTypeParamet ers}) 4343 @override
4344 List<UnlinkedPublicNameBuilder> get executables => _executables ??= <UnlinkedP ublicNameBuilder>[];
4345
4346 /**
4347 * If this [UnlinkedPublicName] is a class, the list of static methods
4348 * and constructors. Otherwise empty.
4349 */
4350 void set executables(List<UnlinkedPublicNameBuilder> _value) {
4351 assert(!_finished);
4352 _executables = _value;
4353 }
4354
4355 UnlinkedPublicNameBuilder({String name, ReferenceKind kind, int numTypeParamet ers, List<UnlinkedPublicNameBuilder> executables})
4333 : _name = name, 4356 : _name = name,
4334 _kind = kind, 4357 _kind = kind,
4335 _numTypeParameters = numTypeParameters; 4358 _numTypeParameters = numTypeParameters,
4359 _executables = executables;
4336 4360
4337 fb.Offset finish(fb.Builder fbBuilder) { 4361 fb.Offset finish(fb.Builder fbBuilder) {
4338 assert(!_finished); 4362 assert(!_finished);
4339 _finished = true; 4363 _finished = true;
4340 fb.Offset offset_name; 4364 fb.Offset offset_name;
4365 fb.Offset offset_executables;
4341 if (_name != null) { 4366 if (_name != null) {
4342 offset_name = fbBuilder.writeString(_name); 4367 offset_name = fbBuilder.writeString(_name);
4343 } 4368 }
4369 if (!(_executables == null || _executables.isEmpty)) {
4370 offset_executables = fbBuilder.writeList(_executables.map((b) => b.finish( fbBuilder)).toList());
4371 }
4344 fbBuilder.startTable(); 4372 fbBuilder.startTable();
4345 if (offset_name != null) { 4373 if (offset_name != null) {
4346 fbBuilder.addOffset(0, offset_name); 4374 fbBuilder.addOffset(0, offset_name);
4347 } 4375 }
4348 if (_kind != null && _kind != ReferenceKind.classOrEnum) { 4376 if (_kind != null && _kind != ReferenceKind.classOrEnum) {
4349 fbBuilder.addUint32(1, _kind.index); 4377 fbBuilder.addUint32(1, _kind.index);
4350 } 4378 }
4351 if (_numTypeParameters != null && _numTypeParameters != 0) { 4379 if (_numTypeParameters != null && _numTypeParameters != 0) {
4352 fbBuilder.addUint32(2, _numTypeParameters); 4380 fbBuilder.addUint32(2, _numTypeParameters);
4353 } 4381 }
4382 if (offset_executables != null) {
4383 fbBuilder.addOffset(3, offset_executables);
4384 }
4354 return fbBuilder.endTable(); 4385 return fbBuilder.endTable();
4355 } 4386 }
4356 } 4387 }
4357 4388
4358 /** 4389 /**
4359 * Unlinked summary information about a specific name contributed by a 4390 * Unlinked summary information about a specific name contributed by a
4360 * compilation unit to a library's public namespace. 4391 * compilation unit to a library's public namespace.
4361 * 4392 *
4362 * TODO(paulberry): add a count of generic parameters, so that resynthesis 4393 * TODO(paulberry): add a count of generic parameters, so that resynthesis
4363 * doesn't have to peek into the library to obtain this info. 4394 * doesn't have to peek into the library to obtain this info.
4364 * 4395 *
4365 * TODO(paulberry): for classes, add info about static members and
4366 * constructors, since this will be needed to prelink info about constants.
4367 *
4368 * TODO(paulberry): some of this information is redundant with information 4396 * TODO(paulberry): some of this information is redundant with information
4369 * elsewhere in the summary. Consider reducing the redundancy to reduce 4397 * elsewhere in the summary. Consider reducing the redundancy to reduce
4370 * summary size. 4398 * summary size.
4371 */ 4399 */
4372 abstract class UnlinkedPublicName extends base.SummaryClass { 4400 abstract class UnlinkedPublicName extends base.SummaryClass {
4373 4401
4374 /** 4402 /**
4375 * The name itself. 4403 * The name itself.
4376 */ 4404 */
4377 String get name; 4405 String get name;
4378 4406
4379 /** 4407 /**
4380 * The kind of object referred to by the name. 4408 * The kind of object referred to by the name.
4381 */ 4409 */
4382 ReferenceKind get kind; 4410 ReferenceKind get kind;
4383 4411
4384 /** 4412 /**
4385 * If the entity being referred to is generic, the number of type parameters 4413 * If the entity being referred to is generic, the number of type parameters
4386 * it accepts. Otherwise zero. 4414 * it accepts. Otherwise zero.
4387 */ 4415 */
4388 int get numTypeParameters; 4416 int get numTypeParameters;
4417
4418 /**
4419 * If this [UnlinkedPublicName] is a class, the list of static methods
4420 * and constructors. Otherwise empty.
4421 */
4422 List<UnlinkedPublicName> get executables;
4389 } 4423 }
4390 4424
4391 class _UnlinkedPublicNameReader extends fb.TableReader<_UnlinkedPublicNameImpl> { 4425 class _UnlinkedPublicNameReader extends fb.TableReader<_UnlinkedPublicNameImpl> {
4392 const _UnlinkedPublicNameReader(); 4426 const _UnlinkedPublicNameReader();
4393 4427
4394 @override 4428 @override
4395 _UnlinkedPublicNameImpl createObject(fb.BufferPointer bp) => new _UnlinkedPubl icNameImpl(bp); 4429 _UnlinkedPublicNameImpl createObject(fb.BufferPointer bp) => new _UnlinkedPubl icNameImpl(bp);
4396 } 4430 }
4397 4431
4398 class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin imple ments UnlinkedPublicName { 4432 class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin imple ments UnlinkedPublicName {
4399 final fb.BufferPointer _bp; 4433 final fb.BufferPointer _bp;
4400 4434
4401 _UnlinkedPublicNameImpl(this._bp); 4435 _UnlinkedPublicNameImpl(this._bp);
4402 4436
4403 String _name; 4437 String _name;
4404 ReferenceKind _kind; 4438 ReferenceKind _kind;
4405 int _numTypeParameters; 4439 int _numTypeParameters;
4440 List<UnlinkedPublicName> _executables;
4406 4441
4407 @override 4442 @override
4408 String get name { 4443 String get name {
4409 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); 4444 _name ??= const fb.StringReader().vTableGet(_bp, 0, '');
4410 return _name; 4445 return _name;
4411 } 4446 }
4412 4447
4413 @override 4448 @override
4414 ReferenceKind get kind { 4449 ReferenceKind get kind {
4415 _kind ??= const _ReferenceKindReader().vTableGet(_bp, 1, ReferenceKind.class OrEnum); 4450 _kind ??= const _ReferenceKindReader().vTableGet(_bp, 1, ReferenceKind.class OrEnum);
4416 return _kind; 4451 return _kind;
4417 } 4452 }
4418 4453
4419 @override 4454 @override
4420 int get numTypeParameters { 4455 int get numTypeParameters {
4421 _numTypeParameters ??= const fb.Uint32Reader().vTableGet(_bp, 2, 0); 4456 _numTypeParameters ??= const fb.Uint32Reader().vTableGet(_bp, 2, 0);
4422 return _numTypeParameters; 4457 return _numTypeParameters;
4423 } 4458 }
4459
4460 @override
4461 List<UnlinkedPublicName> get executables {
4462 _executables ??= const fb.ListReader<UnlinkedPublicName>(const _UnlinkedPubl icNameReader()).vTableGet(_bp, 3, const <UnlinkedPublicName>[]);
4463 return _executables;
4464 }
4424 } 4465 }
4425 4466
4426 abstract class _UnlinkedPublicNameMixin implements UnlinkedPublicName { 4467 abstract class _UnlinkedPublicNameMixin implements UnlinkedPublicName {
4427 @override 4468 @override
4428 Map<String, Object> toMap() => { 4469 Map<String, Object> toMap() => {
4429 "name": name, 4470 "name": name,
4430 "kind": kind, 4471 "kind": kind,
4431 "numTypeParameters": numTypeParameters, 4472 "numTypeParameters": numTypeParameters,
4473 "executables": executables,
4432 }; 4474 };
4433 } 4475 }
4434 4476
4435 class UnlinkedPublicNamespaceBuilder extends Object with _UnlinkedPublicNamespac eMixin implements UnlinkedPublicNamespace { 4477 class UnlinkedPublicNamespaceBuilder extends Object with _UnlinkedPublicNamespac eMixin implements UnlinkedPublicNamespace {
4436 bool _finished = false; 4478 bool _finished = false;
4437 4479
4438 List<UnlinkedPublicNameBuilder> _names; 4480 List<UnlinkedPublicNameBuilder> _names;
4439 List<UnlinkedExportPublicBuilder> _exports; 4481 List<UnlinkedExportPublicBuilder> _exports;
4440 List<String> _parts; 4482 List<String> _parts;
4441 4483
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
5935 "documentationComment": documentationComment, 5977 "documentationComment": documentationComment,
5936 "type": type, 5978 "type": type,
5937 "constExpr": constExpr, 5979 "constExpr": constExpr,
5938 "isStatic": isStatic, 5980 "isStatic": isStatic,
5939 "isFinal": isFinal, 5981 "isFinal": isFinal,
5940 "isConst": isConst, 5982 "isConst": isConst,
5941 "propagatedTypeSlot": propagatedTypeSlot, 5983 "propagatedTypeSlot": propagatedTypeSlot,
5942 }; 5984 };
5943 } 5985 }
5944 5986
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698