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

Unified Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 22067002: Ignore unused classes when constructing set for deferred loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleaned up redundant code. Created 7 years, 4 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: sdk/lib/_internal/compiler/implementation/enqueue.dart
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/sdk/lib/_internal/compiler/implementation/enqueue.dart
index 288065df73d2a6900d2f6d4781c404b3a29d398c..f750960057e48c9492ffd9ef39a8c05349844295 100644
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -572,6 +572,13 @@ class ResolutionEnqueuer extends Enqueuer {
bool isProcessed(Element member) => resolvedElements.containsKey(member);
+ /// Returns [:true:] if [element] has actually been used.
+ bool isLive(Element element) {
+ if (seenClasses.contains(element)) return true;
+ if (getCachedElements(element) != null) return true;
+ return false;
+ }
+
TreeElements getCachedElements(Element element) {
// TODO(ngeoffray): Get rid of this check.
if (element.enclosingElement.isClosure()) {

Powered by Google App Engine
This is Rietveld 408576698