diff options
author | paltherr <paltherr@epfl.ch> | 2003-12-09 16:04:00 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-12-09 16:04:00 +0000 |
commit | 2458b5ce591710a4e28d124f176b29c4481678ba (patch) | |
tree | ea9ec6c29e8842d0f21e02bc3ce59d4c37ae0320 /sources | |
parent | df9d6b1edcf6453444568bd95e289997acfd8648 (diff) | |
download | scala-2458b5ce591710a4e28d124f176b29c4481678ba.tar.gz scala-2458b5ce591710a4e28d124f176b29c4481678ba.tar.bz2 scala-2458b5ce591710a4e28d124f176b29c4481678ba.zip |
- Added class MakeBoxingExplicitPhase
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/transformer/MakeBoxingExplicitPhase.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/sources/scalac/transformer/MakeBoxingExplicitPhase.java b/sources/scalac/transformer/MakeBoxingExplicitPhase.java new file mode 100644 index 0000000000..b901fad647 --- /dev/null +++ b/sources/scalac/transformer/MakeBoxingExplicitPhase.java @@ -0,0 +1,50 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.transformer; + +import scalac.Global; +import scalac.Phase; +import scalac.PhaseDescriptor; +import scalac.Unit; +import scalac.checkers.TreeChecker; +import scalac.symtab.Definitions; + +/** + * This phase makes boxing and unboxing of primitive values and arrays + * explicit. + */ +public class MakeBoxingExplicitPhase extends Phase { + + //######################################################################## + // Private Fields + + private final Definitions definitions; + private final TreeChecker checker; + + //######################################################################## + // Public Constructors + + /** Initializes this instance. */ + public MakeBoxingExplicitPhase(Global global, PhaseDescriptor descriptor) { + super(global, descriptor); + this.definitions = global.definitions; + this.checker = new TreeChecker(definitions); + } + + //######################################################################## + // Public Methods + + public void apply(Unit[] units) { + for (int i = 0; i < units.length; i++) { + assert checker.check(units[i]); + } + } + + //######################################################################## +} |