summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-12-09 16:04:00 +0000
committerpaltherr <paltherr@epfl.ch>2003-12-09 16:04:00 +0000
commit2458b5ce591710a4e28d124f176b29c4481678ba (patch)
treeea9ec6c29e8842d0f21e02bc3ce59d4c37ae0320 /sources
parentdf9d6b1edcf6453444568bd95e289997acfd8648 (diff)
downloadscala-2458b5ce591710a4e28d124f176b29c4481678ba.tar.gz
scala-2458b5ce591710a4e28d124f176b29c4481678ba.tar.bz2
scala-2458b5ce591710a4e28d124f176b29c4481678ba.zip
- Added class MakeBoxingExplicitPhase
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/transformer/MakeBoxingExplicitPhase.java50
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]);
+ }
+ }
+
+ //########################################################################
+}