Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 library analyzer.src.task.dart; | 5 library analyzer.src.task.dart; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 import 'package:analyzer/src/generated/sdk.dart'; | 22 import 'package:analyzer/src/generated/sdk.dart'; |
| 23 import 'package:analyzer/src/generated/source.dart'; | 23 import 'package:analyzer/src/generated/source.dart'; |
| 24 import 'package:analyzer/src/generated/visitors.dart'; | 24 import 'package:analyzer/src/generated/visitors.dart'; |
| 25 import 'package:analyzer/src/plugin/engine_plugin.dart'; | 25 import 'package:analyzer/src/plugin/engine_plugin.dart'; |
| 26 import 'package:analyzer/src/services/lint.dart'; | 26 import 'package:analyzer/src/services/lint.dart'; |
| 27 import 'package:analyzer/src/task/driver.dart'; | 27 import 'package:analyzer/src/task/driver.dart'; |
| 28 import 'package:analyzer/src/task/general.dart'; | 28 import 'package:analyzer/src/task/general.dart'; |
| 29 import 'package:analyzer/src/task/html.dart'; | 29 import 'package:analyzer/src/task/html.dart'; |
| 30 import 'package:analyzer/src/task/inputs.dart'; | 30 import 'package:analyzer/src/task/inputs.dart'; |
| 31 import 'package:analyzer/src/task/model.dart'; | 31 import 'package:analyzer/src/task/model.dart'; |
| 32 import 'package:analyzer/src/task/strong_mode.dart'; | |
| 33 import 'package:analyzer/src/task/strong/checker.dart'; | 32 import 'package:analyzer/src/task/strong/checker.dart'; |
| 34 import 'package:analyzer/src/task/strong/rules.dart'; | 33 import 'package:analyzer/src/task/strong/rules.dart'; |
| 34 import 'package:analyzer/src/task/strong_mode.dart'; | |
| 35 import 'package:analyzer/task/dart.dart'; | 35 import 'package:analyzer/task/dart.dart'; |
| 36 import 'package:analyzer/task/general.dart'; | 36 import 'package:analyzer/task/general.dart'; |
| 37 import 'package:analyzer/task/model.dart'; | 37 import 'package:analyzer/task/model.dart'; |
| 38 | 38 |
| 39 /** | 39 /** |
| 40 * The [ResultCachingPolicy] for ASTs. | 40 * The [ResultCachingPolicy] for ASTs. |
| 41 */ | 41 */ |
| 42 const ResultCachingPolicy AST_CACHING_POLICY = | 42 const ResultCachingPolicy AST_CACHING_POLICY = |
| 43 const SimpleResultCachingPolicy(8192, 8192); | 43 const SimpleResultCachingPolicy(8192, 8192); |
| 44 | 44 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 /** | 155 /** |
| 156 * The sources representing the combined import/export closure of a library. | 156 * The sources representing the combined import/export closure of a library. |
| 157 * The [Source]s include only library sources, not their units. | 157 * The [Source]s include only library sources, not their units. |
| 158 * | 158 * |
| 159 * The result is only available for [Source]s representing a library. | 159 * The result is only available for [Source]s representing a library. |
| 160 */ | 160 */ |
| 161 final ListResultDescriptor<Source> IMPORT_EXPORT_SOURCE_CLOSURE = | 161 final ListResultDescriptor<Source> IMPORT_EXPORT_SOURCE_CLOSURE = |
| 162 new ListResultDescriptor<Source>('IMPORT_EXPORT_SOURCE_CLOSURE', null); | 162 new ListResultDescriptor<Source>('IMPORT_EXPORT_SOURCE_CLOSURE', null); |
| 163 | 163 |
| 164 /** | 164 /** |
| 165 * A list of the [LibraryElement]s that make up the strongly connected | |
| 166 * component in the import/export graph in which the target resides. | |
| 167 * | |
| 168 * Only non-empty in strongMode | |
| 169 * | |
| 170 * The result is only available for [LibrarySpecificUnit]s. | |
| 171 */ | |
| 172 final ListResultDescriptor<LibraryElement> LIBRARY_CYCLE = | |
| 173 new ListResultDescriptor<LibraryElement>('LIBRARY_CYCLE', null); | |
| 174 | |
| 175 /** | |
| 176 * A list of the [CompilationUnitElement]s (including all parts) that make up | |
| 177 * the strongly connected component in the import/export graph in which the | |
| 178 * target resides. | |
| 179 * | |
| 180 * Only non-empty in strongMode | |
| 181 * | |
| 182 * The result is only available for [LibrarySpecificUnit]s. | |
| 183 */ | |
| 184 final ListResultDescriptor<CompilationUnitElement> LIBRARY_CYCLE_UNITS = | |
| 185 new ListResultDescriptor<CompilationUnitElement>( | |
| 186 'LIBRARY_CYCLE_UNITS', null); | |
| 187 | |
| 188 /** | |
| 189 * A list of the [CompilationUnitElement]s that comprise all of the parts and | |
| 190 * libraries in the direct import/export dependencies of the library cycle | |
| 191 * of the target, with the intra-component dependencies excluded. | |
| 192 * | |
| 193 * Only non-empty in strongMode | |
| 194 * | |
| 195 * The result is only available for [LibrarySpecificUnit]s. | |
| 196 */ | |
| 197 final ListResultDescriptor<CompilationUnitElement> LIBRARY_CYCLE_DEPENDENCIES = | |
| 198 new ListResultDescriptor<CompilationUnitElement>( | |
| 199 'LIBRARY_CYCLE_DEPENDENCIES', null); | |
| 200 | |
| 201 /** | |
| 202 * A list of the [VariableElement]s whose type should be inferred that another | 165 * A list of the [VariableElement]s whose type should be inferred that another |
| 203 * inferable static variable (the target) depends on. | 166 * inferable static variable (the target) depends on. |
| 204 * | 167 * |
| 205 * The result is only available for [VariableElement]s, and only when strong | 168 * The result is only available for [VariableElement]s, and only when strong |
| 206 * mode is enabled. | 169 * mode is enabled. |
| 207 */ | 170 */ |
| 208 final ListResultDescriptor< | 171 final ListResultDescriptor< |
| 209 VariableElement> INFERABLE_STATIC_VARIABLE_DEPENDENCIES = | 172 VariableElement> INFERABLE_STATIC_VARIABLE_DEPENDENCIES = |
| 210 new ListResultDescriptor<VariableElement>( | 173 new ListResultDescriptor<VariableElement>( |
| 211 'INFERABLE_STATIC_VARIABLE_DEPENDENCIES', null); | 174 'INFERABLE_STATIC_VARIABLE_DEPENDENCIES', null); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 227 * inferred. | 190 * inferred. |
| 228 * | 191 * |
| 229 * The result is only available for [VariableElement]s, and only when strong | 192 * The result is only available for [VariableElement]s, and only when strong |
| 230 * mode is enabled. | 193 * mode is enabled. |
| 231 */ | 194 */ |
| 232 final ResultDescriptor<VariableElement> INFERRED_STATIC_VARIABLE = | 195 final ResultDescriptor<VariableElement> INFERRED_STATIC_VARIABLE = |
| 233 new ResultDescriptor<VariableElement>('INFERRED_STATIC_VARIABLE', null, | 196 new ResultDescriptor<VariableElement>('INFERRED_STATIC_VARIABLE', null, |
| 234 cachingPolicy: ELEMENT_CACHING_POLICY); | 197 cachingPolicy: ELEMENT_CACHING_POLICY); |
| 235 | 198 |
| 236 /** | 199 /** |
| 200 * A list of the [LibraryElement]s that make up the strongly connected | |
| 201 * component in the import/export graph in which the target resides. | |
| 202 * | |
| 203 * Only non-empty in strongMode | |
|
scheglov
2015/10/15 20:57:39
Add dot?
Brian Wilkerson
2015/10/15 20:59:22
Done
| |
| 204 * | |
| 205 * The result is only available for [LibrarySpecificUnit]s. | |
| 206 */ | |
| 207 final ListResultDescriptor<LibraryElement> LIBRARY_CYCLE = | |
| 208 new ListResultDescriptor<LibraryElement>('LIBRARY_CYCLE', null); | |
| 209 | |
| 210 /** | |
| 211 * A list of the [CompilationUnitElement]s that comprise all of the parts and | |
| 212 * libraries in the direct import/export dependencies of the library cycle | |
| 213 * of the target, with the intra-component dependencies excluded. | |
| 214 * | |
| 215 * Only non-empty in strongMode | |
| 216 * | |
| 217 * The result is only available for [LibrarySpecificUnit]s. | |
| 218 */ | |
| 219 final ListResultDescriptor<CompilationUnitElement> LIBRARY_CYCLE_DEPENDENCIES = | |
| 220 new ListResultDescriptor<CompilationUnitElement>( | |
| 221 'LIBRARY_CYCLE_DEPENDENCIES', null); | |
| 222 | |
| 223 /** | |
| 224 * A list of the [CompilationUnitElement]s (including all parts) that make up | |
| 225 * the strongly connected component in the import/export graph in which the | |
| 226 * target resides. | |
| 227 * | |
| 228 * Only non-empty in strongMode | |
| 229 * | |
| 230 * The result is only available for [LibrarySpecificUnit]s. | |
| 231 */ | |
| 232 final ListResultDescriptor<CompilationUnitElement> LIBRARY_CYCLE_UNITS = | |
| 233 new ListResultDescriptor<CompilationUnitElement>( | |
| 234 'LIBRARY_CYCLE_UNITS', null); | |
| 235 | |
| 236 /** | |
| 237 * The partial [LibraryElement] associated with a library. | 237 * The partial [LibraryElement] associated with a library. |
| 238 * | 238 * |
| 239 * The [LibraryElement] and its [CompilationUnitElement]s are attached to each | 239 * The [LibraryElement] and its [CompilationUnitElement]s are attached to each |
| 240 * other. Directives 'library', 'part' and 'part of' are resolved. | 240 * other. Directives 'library', 'part' and 'part of' are resolved. |
| 241 * | 241 * |
| 242 * The result is only available for [Source]s representing a library. | 242 * The result is only available for [Source]s representing a library. |
| 243 */ | 243 */ |
| 244 final ResultDescriptor<LibraryElement> LIBRARY_ELEMENT1 = | 244 final ResultDescriptor<LibraryElement> LIBRARY_ELEMENT1 = |
| 245 new ResultDescriptor<LibraryElement>('LIBRARY_ELEMENT1', null, | 245 new ResultDescriptor<LibraryElement>('LIBRARY_ELEMENT1', null, |
| 246 cachingPolicy: ELEMENT_CACHING_POLICY); | 246 cachingPolicy: ELEMENT_CACHING_POLICY); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 | 336 |
| 337 /** | 337 /** |
| 338 * The names (resolved and not) referenced by a unit. | 338 * The names (resolved and not) referenced by a unit. |
| 339 * | 339 * |
| 340 * The result is only available for [Source]s representing a compilation unit. | 340 * The result is only available for [Source]s representing a compilation unit. |
| 341 */ | 341 */ |
| 342 final ResultDescriptor<ReferencedNames> REFERENCED_NAMES = | 342 final ResultDescriptor<ReferencedNames> REFERENCED_NAMES = |
| 343 new ResultDescriptor<ReferencedNames>('REFERENCED_NAMES', null); | 343 new ResultDescriptor<ReferencedNames>('REFERENCED_NAMES', null); |
| 344 | 344 |
| 345 /** | 345 /** |
| 346 * The errors produced while resolving type names. | |
| 347 * | |
| 348 * The list will be empty if there were no errors, but will not be `null`. | |
| 349 * | |
| 350 * The result is only available for [LibrarySpecificUnit]s. | |
| 351 */ | |
| 352 final ListResultDescriptor<AnalysisError> RESOLVE_TYPE_NAMES_ERRORS = | |
| 353 new ListResultDescriptor<AnalysisError>( | |
| 354 'RESOLVE_TYPE_NAMES_ERRORS', AnalysisError.NO_ERRORS); | |
| 355 | |
| 356 /** | |
| 346 * The errors produced while resolving a full compilation unit. | 357 * The errors produced while resolving a full compilation unit. |
| 347 * | 358 * |
| 348 * The list will be empty if there were no errors, but will not be `null`. | 359 * The list will be empty if there were no errors, but will not be `null`. |
| 349 * | 360 * |
| 350 * The result is only available for [LibrarySpecificUnit]s. | 361 * The result is only available for [LibrarySpecificUnit]s. |
| 351 */ | 362 */ |
| 352 final ListResultDescriptor<AnalysisError> RESOLVE_UNIT_ERRORS = | 363 final ListResultDescriptor<AnalysisError> RESOLVE_UNIT_ERRORS = |
| 353 new ListResultDescriptor<AnalysisError>( | 364 new ListResultDescriptor<AnalysisError>( |
| 354 'RESOLVE_UNIT_ERRORS', AnalysisError.NO_ERRORS); | 365 'RESOLVE_UNIT_ERRORS', AnalysisError.NO_ERRORS); |
| 355 | 366 |
| 356 /** | 367 /** |
| 357 * The errors produced while resolving type names. | |
| 358 * | |
| 359 * The list will be empty if there were no errors, but will not be `null`. | |
| 360 * | |
| 361 * The result is only available for [LibrarySpecificUnit]s. | |
| 362 */ | |
| 363 final ListResultDescriptor<AnalysisError> RESOLVE_TYPE_NAMES_ERRORS = | |
| 364 new ListResultDescriptor<AnalysisError>( | |
| 365 'RESOLVE_TYPE_NAMES_ERRORS', AnalysisError.NO_ERRORS); | |
| 366 | |
| 367 /** | |
| 368 * The partially resolved [CompilationUnit] associated with a compilation unit. | 368 * The partially resolved [CompilationUnit] associated with a compilation unit. |
| 369 * | 369 * |
| 370 * Tasks that use this value as an input can assume that the [SimpleIdentifier]s | 370 * Tasks that use this value as an input can assume that the [SimpleIdentifier]s |
| 371 * at all declaration sites have been bound to the element defined by the | 371 * at all declaration sites have been bound to the element defined by the |
| 372 * declaration, except for the constants defined in an 'enum' declaration. | 372 * declaration, except for the constants defined in an 'enum' declaration. |
| 373 * | 373 * |
| 374 * The result is only available for [LibrarySpecificUnit]s. | 374 * The result is only available for [LibrarySpecificUnit]s. |
| 375 */ | 375 */ |
| 376 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT1 = | 376 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT1 = |
| 377 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT1', null, | 377 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT1', null, |
| 378 cachingPolicy: AST_CACHING_POLICY); | 378 cachingPolicy: AST_CACHING_POLICY); |
| 379 | 379 |
| 380 /** | 380 /** |
| 381 * The resolved [CompilationUnit] associated with a compilation unit, with | |
| 382 * constants resolved. | |
| 383 * | |
| 384 * The result is only available for [LibrarySpecificUnit]s. | |
| 385 */ | |
| 386 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT10 = | |
| 387 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT10', null, | |
| 388 cachingPolicy: AST_CACHING_POLICY); | |
| 389 | |
| 390 /** | |
| 381 * The partially resolved [CompilationUnit] associated with a compilation unit. | 391 * The partially resolved [CompilationUnit] associated with a compilation unit. |
| 382 * | 392 * |
| 383 * Tasks that use this value as an input can assume that the [SimpleIdentifier]s | 393 * Tasks that use this value as an input can assume that the [SimpleIdentifier]s |
| 384 * at all declaration sites have been bound to the element defined by the | 394 * at all declaration sites have been bound to the element defined by the |
| 385 * declaration, including for the constants defined in an 'enum' declaration. | 395 * declaration, including the constants defined in an 'enum' declaration. |
| 386 * | 396 * |
| 387 * The result is only available for [LibrarySpecificUnit]s. | 397 * The result is only available for [LibrarySpecificUnit]s. |
| 388 */ | 398 */ |
| 389 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT2 = | 399 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT2 = |
| 390 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT2', null, | 400 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT2', null, |
| 391 cachingPolicy: AST_CACHING_POLICY); | 401 cachingPolicy: AST_CACHING_POLICY); |
| 392 | 402 |
| 393 /** | 403 /** |
| 394 * The partially resolved [CompilationUnit] associated with a compilation unit. | 404 * The partially resolved [CompilationUnit] associated with a compilation unit. |
| 395 * | 405 * |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 414 * The result is only available for [LibrarySpecificUnit]s. | 424 * The result is only available for [LibrarySpecificUnit]s. |
| 415 */ | 425 */ |
| 416 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT4 = | 426 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT4 = |
| 417 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT4', null, | 427 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT4', null, |
| 418 cachingPolicy: AST_CACHING_POLICY); | 428 cachingPolicy: AST_CACHING_POLICY); |
| 419 | 429 |
| 420 /** | 430 /** |
| 421 * The partially resolved [CompilationUnit] associated with a compilation unit. | 431 * The partially resolved [CompilationUnit] associated with a compilation unit. |
| 422 * | 432 * |
| 423 * In addition to what is true of a [RESOLVED_UNIT4], tasks that use this value | 433 * In addition to what is true of a [RESOLVED_UNIT4], tasks that use this value |
| 424 * as an input can assume that elements and types have been initially resolved | 434 * as an input can assume that elements and types associated with expressions |
| 425 * outside of method bodies. | 435 * outside of method bodies (essentially initializers) have been initially |
| 436 * resolved. | |
| 426 * | 437 * |
| 427 * The result is only available for [LibrarySpecificUnit]s. | 438 * The result is only available for [LibrarySpecificUnit]s. |
| 428 */ | 439 */ |
| 429 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT5 = | 440 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT5 = |
| 430 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT5', null, | 441 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT5', null, |
| 431 cachingPolicy: AST_CACHING_POLICY); | 442 cachingPolicy: AST_CACHING_POLICY); |
| 432 | 443 |
| 433 /** | 444 /** |
| 434 * The partially resolved [CompilationUnit] associated with a compilation unit. | 445 * The partially resolved [CompilationUnit] associated with a compilation unit. |
| 435 * | 446 * |
| 436 * In addition to what is true of a [RESOLVED_UNIT5], tasks that use this value | 447 * In addition to what is true of a [RESOLVED_UNIT5], tasks that use this value |
| 437 * as an input can assume that the types of static variables have been inferred. | 448 * as an input can assume that the types of static variables have been inferred. |
| 438 * | 449 * |
| 439 * The result is only available for [LibrarySpecificUnit]s. | 450 * The result is only available for [LibrarySpecificUnit]s. |
| 440 */ | 451 */ |
| 441 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT6 = | 452 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT6 = |
| 442 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT6', null, | 453 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT6', null, |
| 443 cachingPolicy: AST_CACHING_POLICY); | 454 cachingPolicy: AST_CACHING_POLICY); |
| 444 | 455 |
| 445 /** | 456 /** |
| 446 * The resolved [CompilationUnit] associated with a compilation unit in which | 457 * The partially resolved [CompilationUnit] associated with a compilation unit. |
| 447 * the right hand sides of instance variables have been re-resolved in addition | 458 * |
| 448 * to everything that is true of a [RESOLVED_UNIT6]. | 459 * In addition to what is true of a [RESOLVED_UNIT6], tasks that use this value |
| 460 * as an input can assume that the initializers of instance variables have been | |
| 461 * re-resolved. | |
| 449 * | 462 * |
| 450 * The result is only available for [LibrarySpecificUnit]s. | 463 * The result is only available for [LibrarySpecificUnit]s. |
| 451 */ | 464 */ |
| 452 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT7 = | 465 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT7 = |
| 453 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT7', null, | 466 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT7', null, |
| 454 cachingPolicy: AST_CACHING_POLICY); | 467 cachingPolicy: AST_CACHING_POLICY); |
| 455 | 468 |
| 456 /** | 469 /** |
| 457 * The resolved [CompilationUnit] associated with a compilation unit in which | 470 * The resolved [CompilationUnit] associated with a compilation unit in which |
| 458 * the types of class members have been inferred in addition to everything that | 471 * the types of class members have been inferred in addition to everything that |
| 459 * is true of a [RESOLVED_UNIT7]. | 472 * is true of a [RESOLVED_UNIT7]. |
| 460 * | 473 * |
| 461 * The result is only available for [LibrarySpecificUnit]s. | 474 * The result is only available for [LibrarySpecificUnit]s. |
| 462 */ | 475 */ |
| 463 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT8 = | 476 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT8 = |
| 464 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT8', null, | 477 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT8', null, |
| 465 cachingPolicy: AST_CACHING_POLICY); | 478 cachingPolicy: AST_CACHING_POLICY); |
| 466 | 479 |
| 467 /** | 480 /** |
| 468 * The resolved [CompilationUnit] associated with a compilation unit, with | 481 * The resolved [CompilationUnit] associated with a compilation unit, with |
| 469 * constants not yet resolved. | 482 * constants not yet resolved. |
| 470 * | 483 * |
| 471 * The result is only available for [LibrarySpecificUnit]s. | 484 * The result is only available for [LibrarySpecificUnit]s. |
| 472 */ | 485 */ |
| 473 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT9 = | 486 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT9 = |
| 474 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT9', null, | 487 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT9', null, |
| 475 cachingPolicy: AST_CACHING_POLICY); | 488 cachingPolicy: AST_CACHING_POLICY); |
| 476 | 489 |
| 477 /** | 490 /** |
| 478 * The resolved [CompilationUnit] associated with a compilation unit, with | |
| 479 * constants resolved. | |
| 480 * | |
| 481 * The result is only available for [LibrarySpecificUnit]s. | |
| 482 */ | |
| 483 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT10 = | |
| 484 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT10', null, | |
| 485 cachingPolicy: AST_CACHING_POLICY); | |
| 486 | |
| 487 /** | |
| 488 * The errors produced while scanning a compilation unit. | 491 * The errors produced while scanning a compilation unit. |
| 489 * | 492 * |
| 490 * The list will be empty if there were no errors, but will not be `null`. | 493 * The list will be empty if there were no errors, but will not be `null`. |
| 491 * | 494 * |
| 492 * The result is only available for [Source]s representing a compilation unit. | 495 * The result is only available for [Source]s representing a compilation unit. |
| 493 */ | 496 */ |
| 494 final ListResultDescriptor<AnalysisError> SCAN_ERRORS = | 497 final ListResultDescriptor<AnalysisError> SCAN_ERRORS = |
| 495 new ListResultDescriptor<AnalysisError>( | 498 new ListResultDescriptor<AnalysisError>( |
| 496 'SCAN_ERRORS', AnalysisError.NO_ERRORS); | 499 'SCAN_ERRORS', AnalysisError.NO_ERRORS); |
| 497 | 500 |
| (...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2726 * Create a [InferInstanceMembersInUnitTask] based on the given [target] in | 2729 * Create a [InferInstanceMembersInUnitTask] based on the given [target] in |
| 2727 * the given [context]. | 2730 * the given [context]. |
| 2728 */ | 2731 */ |
| 2729 static InferInstanceMembersInUnitTask createTask( | 2732 static InferInstanceMembersInUnitTask createTask( |
| 2730 AnalysisContext context, AnalysisTarget target) { | 2733 AnalysisContext context, AnalysisTarget target) { |
| 2731 return new InferInstanceMembersInUnitTask(context, target); | 2734 return new InferInstanceMembersInUnitTask(context, target); |
| 2732 } | 2735 } |
| 2733 } | 2736 } |
| 2734 | 2737 |
| 2735 /** | 2738 /** |
| 2736 * A task that ensures that all of the inferrable instance members in a | |
| 2737 * compilation unit have had their right hand sides re-resolved | |
| 2738 */ | |
| 2739 class ResolveInstanceFieldsInUnitTask extends SourceBasedAnalysisTask { | |
| 2740 /** | |
| 2741 * The name of the [LIBRARY_ELEMENT5] input. | |
| 2742 */ | |
| 2743 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; | |
| 2744 | |
| 2745 /** | |
| 2746 * The name of the [TYPE_PROVIDER] input. | |
| 2747 */ | |
| 2748 static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT'; | |
| 2749 | |
| 2750 /** | |
| 2751 * The name of the input whose value is the [RESOLVED_UNIT6] for the | |
| 2752 * compilation unit. | |
| 2753 */ | |
| 2754 static const String UNIT_INPUT = 'UNIT_INPUT'; | |
| 2755 | |
| 2756 /** | |
| 2757 * The task descriptor describing this kind of task. | |
| 2758 */ | |
| 2759 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( | |
| 2760 'ResolveInstanceFieldsInUnitTask', | |
| 2761 createTask, | |
| 2762 buildInputs, | |
| 2763 <ResultDescriptor>[RESOLVED_UNIT7]); | |
| 2764 | |
| 2765 /** | |
| 2766 * Initialize a newly created task to build a library element for the given | |
| 2767 * [unit] in the given [context]. | |
| 2768 */ | |
| 2769 ResolveInstanceFieldsInUnitTask( | |
| 2770 InternalAnalysisContext context, LibrarySpecificUnit unit) | |
| 2771 : super(context, unit); | |
| 2772 | |
| 2773 @override | |
| 2774 TaskDescriptor get descriptor => DESCRIPTOR; | |
| 2775 | |
| 2776 @override | |
| 2777 void internalPerform() { | |
| 2778 // | |
| 2779 // Prepare inputs. | |
| 2780 // | |
| 2781 LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT); | |
| 2782 CompilationUnit unit = getRequiredInput(UNIT_INPUT); | |
| 2783 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); | |
| 2784 | |
| 2785 CompilationUnitElement unitElement = unit.element; | |
| 2786 if (context.analysisOptions.strongMode) { | |
| 2787 // | |
| 2788 // Resolve references. | |
| 2789 // | |
| 2790 // TODO(leafp): This code only needs to re-resolve the right hand sides of | |
| 2791 // instance fields. We could do incremental resolution on each field | |
| 2792 // only using the incremental resolver. However, this caused a massive | |
| 2793 // performance degredation on the large_class_declaration_test.dart test. | |
| 2794 // I would hypothesize that incremental resolution of field is linear in | |
| 2795 // the size of the enclosing class, and hence incrementally resolving each | |
| 2796 // field was quadratic. We may wish to revisit this if we can resolve | |
| 2797 // this performance issue. | |
| 2798 InheritanceManager inheritanceManager = | |
| 2799 new InheritanceManager(libraryElement); | |
| 2800 PartialResolverVisitor visitor = new PartialResolverVisitor( | |
| 2801 libraryElement, | |
| 2802 unitElement.source, | |
| 2803 typeProvider, | |
| 2804 AnalysisErrorListener.NULL_LISTENER, | |
| 2805 inheritanceManager: inheritanceManager); | |
| 2806 unit.accept(visitor); | |
| 2807 } | |
| 2808 // | |
| 2809 // Record outputs. | |
| 2810 // | |
| 2811 outputs[RESOLVED_UNIT7] = unit; | |
| 2812 } | |
| 2813 | |
| 2814 /** | |
| 2815 * Return a map from the names of the inputs of this kind of task to the task | |
| 2816 * input descriptors describing those inputs for a task with the given | |
| 2817 * [libSource]. | |
| 2818 */ | |
| 2819 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | |
| 2820 LibrarySpecificUnit unit = target; | |
| 2821 return <String, TaskInput>{ | |
| 2822 UNIT_INPUT: RESOLVED_UNIT6.of(unit), | |
| 2823 LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library), | |
| 2824 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | |
| 2825 // In strong mode, add additional dependencies to enforce inference | |
| 2826 // ordering. | |
| 2827 | |
| 2828 // Require that static variable inference be complete for all units in | |
| 2829 // the current library cycle. | |
| 2830 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | |
| 2831 (CompilationUnitElementImpl unit) => RESOLVED_UNIT6 | |
| 2832 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))), | |
| 2833 // Require that full inference be complete for all dependencies of the | |
| 2834 // current library cycle. | |
| 2835 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | |
| 2836 (CompilationUnitElementImpl unit) => RESOLVED_UNIT8 | |
| 2837 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) | |
| 2838 }; | |
| 2839 } | |
| 2840 | |
| 2841 /** | |
| 2842 * Create a [ResolveInstanceFieldsInUnitTask] based on the given [target] in | |
| 2843 * the given [context]. | |
| 2844 */ | |
| 2845 static ResolveInstanceFieldsInUnitTask createTask( | |
| 2846 AnalysisContext context, AnalysisTarget target) { | |
| 2847 return new ResolveInstanceFieldsInUnitTask(context, target); | |
| 2848 } | |
| 2849 } | |
| 2850 | |
| 2851 /** | |
| 2852 * An abstract class that defines utility methods that are useful for tasks | 2739 * An abstract class that defines utility methods that are useful for tasks |
| 2853 * operating on static variables. | 2740 * operating on static variables. |
| 2854 */ | 2741 */ |
| 2855 abstract class InferStaticVariableTask extends ConstantEvaluationAnalysisTask { | 2742 abstract class InferStaticVariableTask extends ConstantEvaluationAnalysisTask { |
| 2856 InferStaticVariableTask( | 2743 InferStaticVariableTask( |
| 2857 InternalAnalysisContext context, VariableElement variable) | 2744 InternalAnalysisContext context, VariableElement variable) |
| 2858 : super(context, variable); | 2745 : super(context, variable); |
| 2859 | 2746 |
| 2860 /** | 2747 /** |
| 2861 * Return the declaration of the target within the given compilation [unit]. | 2748 * Return the declaration of the target within the given compilation [unit]. |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3684 String name = node.name; | 3571 String name = node.name; |
| 3685 names.names.add(name); | 3572 names.names.add(name); |
| 3686 if (dependsOn != null && bodyLevel == 0) { | 3573 if (dependsOn != null && bodyLevel == 0) { |
| 3687 dependsOn.add(name); | 3574 dependsOn.add(name); |
| 3688 } | 3575 } |
| 3689 } | 3576 } |
| 3690 } | 3577 } |
| 3691 } | 3578 } |
| 3692 | 3579 |
| 3693 /** | 3580 /** |
| 3694 * A task that resolves the bodies of top-level functions, constructors, and | 3581 * A task that ensures that all of the inferrable instance members in a |
| 3695 * methods within a single compilation unit. | 3582 * compilation unit have had their right hand sides re-resolved |
| 3696 */ | 3583 */ |
| 3697 class ResolveUnitTask extends SourceBasedAnalysisTask { | 3584 class ResolveInstanceFieldsInUnitTask extends SourceBasedAnalysisTask { |
| 3698 /** | 3585 /** |
| 3699 * The name of the input whose value is the defining [LIBRARY_ELEMENT5]. | 3586 * The name of the [LIBRARY_ELEMENT5] input. |
| 3700 */ | 3587 */ |
| 3701 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; | 3588 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; |
| 3702 | 3589 |
| 3703 /** | 3590 /** |
| 3704 * The name of the [TYPE_PROVIDER] input. | 3591 * The name of the [TYPE_PROVIDER] input. |
| 3705 */ | 3592 */ |
| 3706 static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT'; | 3593 static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT'; |
| 3707 | 3594 |
| 3708 /** | 3595 /** |
| 3709 * The name of the [RESOLVED_UNIT8] input. | 3596 * The name of the input whose value is the [RESOLVED_UNIT6] for the |
| 3597 * compilation unit. | |
| 3710 */ | 3598 */ |
| 3711 static const String UNIT_INPUT = 'UNIT_INPUT'; | 3599 static const String UNIT_INPUT = 'UNIT_INPUT'; |
| 3712 | 3600 |
| 3601 /** | |
| 3602 * The task descriptor describing this kind of task. | |
| 3603 */ | |
| 3713 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( | 3604 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( |
| 3714 'ResolveUnitTask', | 3605 'ResolveInstanceFieldsInUnitTask', |
| 3715 createTask, | 3606 createTask, |
| 3716 buildInputs, | 3607 buildInputs, |
| 3717 <ResultDescriptor>[RESOLVE_UNIT_ERRORS, RESOLVED_UNIT9]); | 3608 <ResultDescriptor>[RESOLVED_UNIT7]); |
| 3718 | 3609 |
| 3719 ResolveUnitTask( | 3610 /** |
| 3720 InternalAnalysisContext context, LibrarySpecificUnit compilationUnit) | 3611 * Initialize a newly created task to build a library element for the given |
| 3721 : super(context, compilationUnit); | 3612 * [unit] in the given [context]. |
| 3613 */ | |
| 3614 ResolveInstanceFieldsInUnitTask( | |
| 3615 InternalAnalysisContext context, LibrarySpecificUnit unit) | |
| 3616 : super(context, unit); | |
| 3722 | 3617 |
| 3723 @override | 3618 @override |
| 3724 TaskDescriptor get descriptor => DESCRIPTOR; | 3619 TaskDescriptor get descriptor => DESCRIPTOR; |
| 3725 | 3620 |
| 3726 @override | 3621 @override |
| 3727 void internalPerform() { | 3622 void internalPerform() { |
| 3728 // | 3623 // |
| 3729 // Prepare inputs. | 3624 // Prepare inputs. |
| 3730 // | 3625 // |
| 3731 LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT); | 3626 LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT); |
| 3732 CompilationUnit unit = getRequiredInput(UNIT_INPUT); | 3627 CompilationUnit unit = getRequiredInput(UNIT_INPUT); |
| 3733 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); | 3628 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); |
| 3734 // | 3629 |
| 3735 // Resolve everything | |
| 3736 // | |
| 3737 CompilationUnitElement unitElement = unit.element; | 3630 CompilationUnitElement unitElement = unit.element; |
| 3738 RecordingErrorListener errorListener = new RecordingErrorListener(); | 3631 if (context.analysisOptions.strongMode) { |
| 3739 ResolverVisitor visitor = new ResolverVisitor( | 3632 // |
| 3740 libraryElement, unitElement.source, typeProvider, errorListener); | 3633 // Resolve references. |
| 3741 unit.accept(visitor); | 3634 // |
| 3635 // TODO(leafp): This code only needs to re-resolve the right hand sides of | |
| 3636 // instance fields. We could do incremental resolution on each field | |
| 3637 // only using the incremental resolver. However, this caused a massive | |
| 3638 // performance degredation on the large_class_declaration_test.dart test. | |
| 3639 // I would hypothesize that incremental resolution of field is linear in | |
| 3640 // the size of the enclosing class, and hence incrementally resolving each | |
| 3641 // field was quadratic. We may wish to revisit this if we can resolve | |
| 3642 // this performance issue. | |
| 3643 InheritanceManager inheritanceManager = | |
| 3644 new InheritanceManager(libraryElement); | |
| 3645 PartialResolverVisitor visitor = new PartialResolverVisitor( | |
| 3646 libraryElement, | |
| 3647 unitElement.source, | |
| 3648 typeProvider, | |
| 3649 AnalysisErrorListener.NULL_LISTENER, | |
| 3650 inheritanceManager: inheritanceManager); | |
| 3651 unit.accept(visitor); | |
| 3652 } | |
| 3742 // | 3653 // |
| 3743 // Record outputs. | 3654 // Record outputs. |
| 3744 // | 3655 // |
| 3745 outputs[RESOLVE_UNIT_ERRORS] = errorListener.errors; | 3656 outputs[RESOLVED_UNIT7] = unit; |
| 3746 outputs[RESOLVED_UNIT9] = unit; | |
| 3747 } | 3657 } |
| 3748 | 3658 |
| 3749 /** | 3659 /** |
| 3750 * Return a map from the names of the inputs of this kind of task to the task | 3660 * Return a map from the names of the inputs of this kind of task to the task |
| 3751 * input descriptors describing those inputs for a task with the given | 3661 * input descriptors describing those inputs for a task with the given |
| 3752 * [target]. | 3662 * [libSource]. |
| 3753 */ | 3663 */ |
| 3754 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 3664 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 3755 LibrarySpecificUnit unit = target; | 3665 LibrarySpecificUnit unit = target; |
| 3756 return <String, TaskInput>{ | 3666 return <String, TaskInput>{ |
| 3667 UNIT_INPUT: RESOLVED_UNIT6.of(unit), | |
| 3757 LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library), | 3668 LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library), |
| 3758 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 3669 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 3759 UNIT_INPUT: RESOLVED_UNIT8.of(unit), | |
| 3760 // In strong mode, add additional dependencies to enforce inference | 3670 // In strong mode, add additional dependencies to enforce inference |
| 3761 // ordering. | 3671 // ordering. |
| 3762 | 3672 |
| 3763 // Require that inference be complete for all units in the | 3673 // Require that static variable inference be complete for all units in |
| 3674 // the current library cycle. | |
| 3675 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | |
| 3676 (CompilationUnitElementImpl unit) => RESOLVED_UNIT6 | |
| 3677 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))), | |
| 3678 // Require that full inference be complete for all dependencies of the | |
| 3764 // current library cycle. | 3679 // current library cycle. |
| 3765 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | 3680 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( |
| 3766 (CompilationUnitElementImpl unit) => RESOLVED_UNIT8 | 3681 (CompilationUnitElementImpl unit) => RESOLVED_UNIT8 |
| 3767 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) | 3682 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) |
| 3768 }; | 3683 }; |
| 3769 } | 3684 } |
| 3770 | 3685 |
| 3771 /** | 3686 /** |
| 3772 * Create a [ResolveUnitTask] based on the given [target] in | 3687 * Create a [ResolveInstanceFieldsInUnitTask] based on the given [target] in |
| 3773 * the given [context]. | 3688 * the given [context]. |
| 3774 */ | 3689 */ |
| 3775 static ResolveUnitTask createTask( | 3690 static ResolveInstanceFieldsInUnitTask createTask( |
| 3776 AnalysisContext context, AnalysisTarget target) { | 3691 AnalysisContext context, AnalysisTarget target) { |
| 3777 return new ResolveUnitTask(context, target); | 3692 return new ResolveInstanceFieldsInUnitTask(context, target); |
| 3778 } | 3693 } |
| 3779 } | 3694 } |
| 3780 | 3695 |
| 3781 /** | 3696 /** |
| 3782 * A task that finishes resolution by requesting [RESOLVED_UNIT_NO_CONSTANTS] fo r every | 3697 * A task that finishes resolution by requesting [RESOLVED_UNIT_NO_CONSTANTS] fo r every |
| 3783 * unit in the libraries closure and produces [LIBRARY_ELEMENT]. | 3698 * unit in the libraries closure and produces [LIBRARY_ELEMENT]. |
| 3784 */ | 3699 */ |
| 3785 class ResolveLibraryReferencesTask extends SourceBasedAnalysisTask { | 3700 class ResolveLibraryReferencesTask extends SourceBasedAnalysisTask { |
| 3786 /** | 3701 /** |
| 3787 * The name of the [LIBRARY_ELEMENT5] input. | 3702 * The name of the [LIBRARY_ELEMENT5] input. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3907 * Create a [ResolveLibraryTypeNamesTask] based on the given [target] in | 3822 * Create a [ResolveLibraryTypeNamesTask] based on the given [target] in |
| 3908 * the given [context]. | 3823 * the given [context]. |
| 3909 */ | 3824 */ |
| 3910 static ResolveLibraryTypeNamesTask createTask( | 3825 static ResolveLibraryTypeNamesTask createTask( |
| 3911 AnalysisContext context, AnalysisTarget target) { | 3826 AnalysisContext context, AnalysisTarget target) { |
| 3912 return new ResolveLibraryTypeNamesTask(context, target); | 3827 return new ResolveLibraryTypeNamesTask(context, target); |
| 3913 } | 3828 } |
| 3914 } | 3829 } |
| 3915 | 3830 |
| 3916 /** | 3831 /** |
| 3832 * A task that resolves the bodies of top-level functions, constructors, and | |
| 3833 * methods within a single compilation unit. | |
| 3834 */ | |
| 3835 class ResolveUnitTask extends SourceBasedAnalysisTask { | |
| 3836 /** | |
| 3837 * The name of the input whose value is the defining [LIBRARY_ELEMENT5]. | |
| 3838 */ | |
| 3839 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; | |
| 3840 | |
| 3841 /** | |
| 3842 * The name of the [TYPE_PROVIDER] input. | |
| 3843 */ | |
| 3844 static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT'; | |
| 3845 | |
| 3846 /** | |
| 3847 * The name of the [RESOLVED_UNIT8] input. | |
| 3848 */ | |
| 3849 static const String UNIT_INPUT = 'UNIT_INPUT'; | |
| 3850 | |
| 3851 static final TaskDescriptor DESCRIPTOR = new TaskDescriptor( | |
| 3852 'ResolveUnitTask', | |
| 3853 createTask, | |
| 3854 buildInputs, | |
| 3855 <ResultDescriptor>[RESOLVE_UNIT_ERRORS, RESOLVED_UNIT9]); | |
| 3856 | |
| 3857 ResolveUnitTask( | |
| 3858 InternalAnalysisContext context, LibrarySpecificUnit compilationUnit) | |
| 3859 : super(context, compilationUnit); | |
| 3860 | |
| 3861 @override | |
| 3862 TaskDescriptor get descriptor => DESCRIPTOR; | |
| 3863 | |
| 3864 @override | |
| 3865 void internalPerform() { | |
| 3866 // | |
| 3867 // Prepare inputs. | |
| 3868 // | |
| 3869 LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT); | |
| 3870 CompilationUnit unit = getRequiredInput(UNIT_INPUT); | |
| 3871 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); | |
| 3872 // | |
| 3873 // Resolve everything. | |
| 3874 // | |
| 3875 CompilationUnitElement unitElement = unit.element; | |
| 3876 RecordingErrorListener errorListener = new RecordingErrorListener(); | |
| 3877 ResolverVisitor visitor = new ResolverVisitor( | |
| 3878 libraryElement, unitElement.source, typeProvider, errorListener); | |
| 3879 unit.accept(visitor); | |
| 3880 // | |
| 3881 // Record outputs. | |
| 3882 // | |
| 3883 outputs[RESOLVE_UNIT_ERRORS] = errorListener.errors; | |
| 3884 outputs[RESOLVED_UNIT9] = unit; | |
| 3885 } | |
| 3886 | |
| 3887 /** | |
| 3888 * Return a map from the names of the inputs of this kind of task to the task | |
| 3889 * input descriptors describing those inputs for a task with the given | |
| 3890 * [target]. | |
| 3891 */ | |
| 3892 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | |
| 3893 LibrarySpecificUnit unit = target; | |
| 3894 return <String, TaskInput>{ | |
| 3895 LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library), | |
| 3896 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | |
| 3897 UNIT_INPUT: RESOLVED_UNIT8.of(unit), | |
| 3898 // In strong mode, add additional dependencies to enforce inference | |
| 3899 // ordering. | |
| 3900 | |
| 3901 // Require that inference be complete for all units in the | |
| 3902 // current library cycle. | |
| 3903 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | |
| 3904 (CompilationUnitElementImpl unit) => RESOLVED_UNIT8 | |
| 3905 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) | |
| 3906 }; | |
| 3907 } | |
| 3908 | |
| 3909 /** | |
| 3910 * Create a [ResolveUnitTask] based on the given [target] in | |
| 3911 * the given [context]. | |
| 3912 */ | |
| 3913 static ResolveUnitTask createTask( | |
| 3914 AnalysisContext context, AnalysisTarget target) { | |
| 3915 return new ResolveUnitTask(context, target); | |
| 3916 } | |
| 3917 } | |
| 3918 | |
| 3919 /** | |
| 3917 * A task that builds [RESOLVED_UNIT3] for a unit. | 3920 * A task that builds [RESOLVED_UNIT3] for a unit. |
| 3918 */ | 3921 */ |
| 3919 class ResolveUnitTypeNamesTask extends SourceBasedAnalysisTask { | 3922 class ResolveUnitTypeNamesTask extends SourceBasedAnalysisTask { |
| 3920 /** | 3923 /** |
| 3921 * The name of the input whose value is the defining [LIBRARY_ELEMENT4]. | 3924 * The name of the input whose value is the defining [LIBRARY_ELEMENT4]. |
| 3922 */ | 3925 */ |
| 3923 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; | 3926 static const String LIBRARY_INPUT = 'LIBRARY_INPUT'; |
| 3924 | 3927 |
| 3925 /** | 3928 /** |
| 3926 * The name of the [RESOLVED_UNIT2] input. | 3929 * The name of the [RESOLVED_UNIT2] input. |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4525 | 4528 |
| 4526 @override | 4529 @override |
| 4527 bool moveNext() { | 4530 bool moveNext() { |
| 4528 if (_newSources.isEmpty) { | 4531 if (_newSources.isEmpty) { |
| 4529 return false; | 4532 return false; |
| 4530 } | 4533 } |
| 4531 currentTarget = _newSources.removeLast(); | 4534 currentTarget = _newSources.removeLast(); |
| 4532 return true; | 4535 return true; |
| 4533 } | 4536 } |
| 4534 } | 4537 } |
| OLD | NEW |