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

Unified Diff: lib/src/info.dart

Issue 1788973002: Remove code that requires whole-program compile (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merged Created 4 years, 9 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 | « lib/src/compiler.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/info.dart
diff --git a/lib/src/info.dart b/lib/src/info.dart
deleted file mode 100644
index f3ab5fd68a6275a07d992fb5d1f14a4029468932..0000000000000000000000000000000000000000
--- a/lib/src/info.dart
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Defines static information collected by the type checker and used later by
-/// emitters to generate code.
-
-import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/src/dart/ast/ast.dart';
-import 'package:analyzer/src/dart/ast/utilities.dart';
-import 'package:analyzer/src/generated/parser.dart';
-
-import 'utils.dart' as utils;
-
-import 'package:analyzer/src/task/strong/info.dart';
-export 'package:analyzer/src/task/strong/info.dart';
-
-/// Represents a summary of the results collected by running the program
-/// checker.
-class CheckerResults {
- final List<LibraryInfo> libraries;
- final bool failure;
-
- CheckerResults(this.libraries, this.failure);
-}
-
-/// Computed information about each library.
-class LibraryInfo {
- /// Canonical name of the library. This is unfortunately not derived from the
- /// library directive as it doesn't have any meaningful rules enforced.
- /// Instead, this is inferred from the path to the file defining the library.
- final String name;
-
- /// Corresponding analyzer element.
- final LibraryElement library;
-
- LibraryInfo(library)
- : library = library,
- name = utils.canonicalLibraryName(library);
-}
-
-class LibraryUnit {
- final CompilationUnit library;
- final List<CompilationUnit> parts;
-
- LibraryUnit(this.library, this.parts);
-
- Iterable<CompilationUnit> get libraryThenParts sync* {
- yield library;
- yield* parts;
- }
-
- Iterable<CompilationUnit> get partsThenLibrary sync* {
- yield* parts;
- yield library;
- }
-
- /// Creates a clone of this library's AST.
- LibraryUnit clone() {
- return new LibraryUnit(
- _cloneUnit(library), parts.map(_cloneUnit).toList(growable: false));
- }
-
- static CompilationUnit _cloneUnit(CompilationUnit oldNode) {
- var newNode = oldNode.accept(new _AstCloner());
- ResolutionCopier.copyResolutionData(oldNode, newNode);
- return newNode;
- }
-}
-
-class _AstCloner extends AstCloner {
- void _cloneProperties(AstNode clone, AstNode node) {
- if (clone != null) {
- CoercionInfo.set(clone, CoercionInfo.get(node));
- DynamicInvoke.set(clone, DynamicInvoke.get(node));
- }
- }
-
- @override
- AstNode cloneNode(AstNode node) {
- var clone = super.cloneNode(node);
- _cloneProperties(clone, node);
- return clone;
- }
-
- @override
- List cloneNodeList(List list) {
- var clone = super.cloneNodeList(list);
- for (int i = 0, len = list.length; i < len; i++) {
- _cloneProperties(clone[i], list[i]);
- }
- return clone;
- }
-
- // TODO(jmesserly): ResolutionCopier is not copying this yet.
- @override
- BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) {
- var clone = super.visitBlockFunctionBody(node);
- (clone as FunctionBodyImpl).localVariableInfo =
- (node as FunctionBodyImpl).localVariableInfo;
- return clone;
- }
-
- @override
- ExpressionFunctionBody visitExpressionFunctionBody(
- ExpressionFunctionBody node) {
- var clone = super.visitExpressionFunctionBody(node);
- (clone as FunctionBodyImpl).localVariableInfo =
- (node as FunctionBodyImpl).localVariableInfo;
- return clone;
- }
-}
« no previous file with comments | « lib/src/compiler.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698