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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart

Issue 21339002: Rename MirrorSystem.getName calls in dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/dart_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
index 4c29888220cbbf0135c41aa9753413b59d7506be..fc258ebeb5baa93715771277321562ad52b4a4da 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
@@ -122,6 +122,7 @@ class DartBackend extends Backend {
final bool stripAsserts;
// TODO(antonm): make available from command-line options.
final bool outputAst = false;
+ final bool mirrorHelping = false;
Map<Element, TreeElements> get resolvedElements =>
compiler.enqueuer.resolution.resolvedElements;
@@ -443,6 +444,23 @@ class DartBackend extends Backend {
}
}
+ bool mirrorLibraryIsInUse() {
+ return compiler.libraries.values.contains(compiler.mirrorsLibrary);
ahe 2013/07/31 13:16:28 This would have the same effect and be a little fa
zarah 2013/08/02 07:53:41 Done.
+ }
+
+ MirrorCollector mirrorCollector =
+ new MirrorCollector(renames, imports, compiler, elementAsts);
+ collectMirrorElements(element) {
+ mirrorCollector.collect(element);
+ if (element.isClass()) {
+ classMembers[element].forEach(collectMirrorElements);
+ }
+ }
+
+ if(mirrorHelping && mirrorLibraryIsInUse()) {
ahe 2013/07/31 13:16:28 Add space after if.
zarah 2013/08/02 07:53:41 Done.
+ topLevelElements.forEach(collectMirrorElements);
+ }
+
final unparser = new EmitterUnparser(renames);
emitCode(unparser, imports, topLevelNodes, memberNodes);
compiler.assembledCode = unparser.result;

Powered by Google App Engine
This is Rietveld 408576698