Chromium Code Reviews| 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; |