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

Unified Diff: lib/compiler/implementation/dart_backend/emitter.dart

Issue 10836128: A visitor that builds a map from node to "Usage". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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: lib/compiler/implementation/dart_backend/emitter.dart
diff --git a/lib/compiler/implementation/dart_backend/emitter.dart b/lib/compiler/implementation/dart_backend/emitter.dart
index eecd40e22762fc7ff33af98a95b294870f62fbc7..2805c3f2e517ba2e78bc698577bef9bf6a7d1f62 100644
--- a/lib/compiler/implementation/dart_backend/emitter.dart
+++ b/lib/compiler/implementation/dart_backend/emitter.dart
@@ -12,17 +12,15 @@ class Emitter {
final ConflictingRenamer renamer;
final Set<VariableListElement> processedVariableLists;
- Emitter(Compiler compiler) :
- this.compiler = compiler,
+ Emitter(this.compiler, this.renamer) :
sb = new StringBuffer(),
- renamer = new ConflictingRenamer(compiler),
processedVariableLists = new Set<VariableListElement>();
/**
* Outputs given class element with selected inner elements.
*/
void outputClass(ClassElement classElement, Set<Element> innerElements) {
- Unparser unparser = new Unparser(renamer);
+ Unparser unparser = new Unparser.withRenamer(renamer.rename);
ClassNode classNode = classElement.parseNode(compiler);
// classElement.beginToken is 'class', 'interface', or 'abstract'.
sb.add(classElement.beginToken.slowToString());
@@ -35,7 +33,6 @@ class Emitter {
if (classNode.typeParameters !== null) {
sb.add(unparser.unparse(classNode.typeParameters));
}
- renamer.setContext(classElement);
if (classNode.extendsKeyword !== null) {
sb.add(' ');
classNode.extendsKeyword.value.printOn(sb);
@@ -59,8 +56,7 @@ class Emitter {
}
void outputElement(Element element) {
- Unparser unparser = new Unparser(renamer);
- renamer.setContext(element);
+ Unparser unparser = new Unparser.withRenamer(renamer.rename);
// TODO(smok): Figure out why AbstractFieldElement appears here,
// we have used getters/setters resolved instead of it.
if (element is SynthesizedConstructorElement
« no previous file with comments | « lib/compiler/implementation/dart_backend/dart_backend.dart ('k') | lib/compiler/implementation/dart_backend/placeholder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698