diff options
author | paltherr <paltherr@epfl.ch> | 2004-01-25 13:19:18 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-01-25 13:19:18 +0000 |
commit | 30d9763761a0daad22e7f1fc84b762079d966c17 (patch) | |
tree | 2c0b04e6940df700fbb676febce12c09a36bcaaf /sources | |
parent | d3aeb53f30f8372b6df8355bdcbbd66eb23e9219 (diff) | |
download | scala-30d9763761a0daad22e7f1fc84b762079d966c17.tar.gz scala-30d9763761a0daad22e7f1fc84b762079d966c17.tar.bz2 scala-30d9763761a0daad22e7f1fc84b762079d966c17.zip |
- Removed renamer from SymbolCloner
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/symtab/SymbolCloner.java | 31 | ||||
-rw-r--r-- | sources/scalac/transformer/ExpandMixinsPhase.java | 6 |
2 files changed, 9 insertions, 28 deletions
diff --git a/sources/scalac/symtab/SymbolCloner.java b/sources/scalac/symtab/SymbolCloner.java index 6df8eb8bca..1e9cba62c1 100644 --- a/sources/scalac/symtab/SymbolCloner.java +++ b/sources/scalac/symtab/SymbolCloner.java @@ -11,7 +11,6 @@ package scalac.symtab; import java.util.Map; import java.util.HashMap; -import scalac.util.FreshNameCreator; import scalac.util.Debug; /** @@ -25,9 +24,6 @@ public class SymbolCloner { //######################################################################## // Public Fields - /** The fresh name generator used to rename cloned symbols */ - public final FreshNameCreator renamer; - /** A table that maps owners of symbols to owners of cloned symbols */ public final Map/*<Symbol,Symbol*/ owners; @@ -38,18 +34,17 @@ public class SymbolCloner { // Public Constructor /** Initializes a new instance. */ - public SymbolCloner(FreshNameCreator renamer) { - this(renamer, new HashMap()); + public SymbolCloner() { + this(new HashMap()); } /** Initializes a new instance. */ - public SymbolCloner(FreshNameCreator renamer, Map owners) { - this(renamer, owners, new HashMap()); + public SymbolCloner(Map owners) { + this(owners, new HashMap()); } /** Initializes a new instance. */ - public SymbolCloner(FreshNameCreator renamer, Map owners, Map clones) { - this.renamer = renamer; + public SymbolCloner(Map owners, Map clones) { this.owners = owners; this.clones = clones; } @@ -73,11 +68,6 @@ public class SymbolCloner { /** Clones the given symbol. */ public Symbol cloneSymbol(Symbol symbol) { - return cloneSymbol(symbol, false); - } - - /** Clones the given symbol and renames it if rename is true. */ - public Symbol cloneSymbol(Symbol symbol, boolean rename) { assert !symbol.isPrimaryConstructor() : Debug.show(symbol); assert !symbol.isModuleClass() : Debug.show(symbol); assert !symbol.isClass() : Debug.show(symbol); @@ -86,10 +76,6 @@ public class SymbolCloner { assert !clones.containsKey(symbol) : Debug.show(symbol) + " -> " + Debug.show(clones.get(symbol)); Symbol clone = symbol.cloneSymbol(getOwnerFor(symbol)); - if (rename) { - assert !symbol.isConstructor() : Debug.show(symbol); - clone.name = renamer.newName(symbol.name); - } clones.put(symbol, clone); clone.setType(cloneType(symbol.info())); return clone; @@ -97,15 +83,10 @@ public class SymbolCloner { /** Clones the given symbols. */ public Symbol[] cloneSymbols(Symbol[] symbols) { - return cloneSymbols(symbols, false); - } - - /** Clones the given symbols and renames them if rename is true. */ - public Symbol[] cloneSymbols(Symbol[] symbols, boolean rename) { if (symbols.length == 0) return Symbol.EMPTY_ARRAY; Symbol[] clones = new Symbol[symbols.length]; for (int i = 0; i < clones.length; i++) - clones[i] = cloneSymbol(symbols[i], rename); + clones[i] = cloneSymbol(symbols[i]); return clones; } diff --git a/sources/scalac/transformer/ExpandMixinsPhase.java b/sources/scalac/transformer/ExpandMixinsPhase.java index 261c52354b..575a01c959 100644 --- a/sources/scalac/transformer/ExpandMixinsPhase.java +++ b/sources/scalac/transformer/ExpandMixinsPhase.java @@ -317,7 +317,7 @@ public class ExpandMixinsPhase extends Phase { assert clasz.isClass() && !clasz.isInterface(): Debug.show(clasz); TypeTransformer transformer =(TypeTransformer)transformers.get(clasz); if (transformer == null) { - transformer = new TypeTransformer(global, clasz); + transformer = new TypeTransformer(clasz); transformers.put(clasz, transformer); } return transformer; @@ -357,9 +357,9 @@ public class ExpandMixinsPhase extends Phase { public final SymbolCloner cloner; public final Map/*<Symbol,Type>*/ inlines; - public TypeTransformer(Global global, Symbol clasz) { + public TypeTransformer(Symbol clasz) { this.clasz = clasz; - this.cloner = new SymbolCloner(global.freshNameCreator); + this.cloner = new SymbolCloner(); this.inlines = new HashMap(); initialize(); } |