summaryrefslogtreecommitdiff
path: root/chapter14/src
diff options
context:
space:
mode:
authorRobertObkircher <robert.obkircher@gmail.com>2025-02-16 20:31:23 +0100
committerGitHub <noreply@github.com>2025-02-16 11:31:23 -0800
commit53452331d8e69dc3bcd40a56a4f00f9380140e73 (patch)
tree855ae54527a24df1a9506ec09d5a056f5be90759 /chapter14/src
parent9d6e0fd1f8720f92164a3163d2f87a642300145d (diff)
downloadSimple-53452331d8e69dc3bcd40a56a4f00f9380140e73.tar.gz
Simple-53452331d8e69dc3bcd40a56a4f00f9380140e73.zip
Cleanup (#162)
* remove unused method lazyFRef * remove unused method copyF(Node, Node) * make TypeMemPtr constants final * make ConstantNode value final
Diffstat (limited to 'chapter14/src')
-rw-r--r--chapter14/src/main/java/com/seaofnodes/simple/node/BoolNode.java1
-rw-r--r--chapter14/src/main/java/com/seaofnodes/simple/node/ConstantNode.java2
-rw-r--r--chapter14/src/main/java/com/seaofnodes/simple/type/TypeMemPtr.java10
3 files changed, 6 insertions, 7 deletions
diff --git a/chapter14/src/main/java/com/seaofnodes/simple/node/BoolNode.java b/chapter14/src/main/java/com/seaofnodes/simple/node/BoolNode.java
index f0cca1e2..ae042f30 100644
--- a/chapter14/src/main/java/com/seaofnodes/simple/node/BoolNode.java
+++ b/chapter14/src/main/java/com/seaofnodes/simple/node/BoolNode.java
@@ -52,7 +52,6 @@ abstract public class BoolNode extends Node {
TypeInteger doOp(TypeInteger t1, TypeInteger t2) { throw Utils.TODO(); }
boolean doOp(double lhs, double rhs) { throw Utils.TODO(); }
- Node copyF(Node lhs, Node rhs) { return null; }
@Override
public Node idealize() {
diff --git a/chapter14/src/main/java/com/seaofnodes/simple/node/ConstantNode.java b/chapter14/src/main/java/com/seaofnodes/simple/node/ConstantNode.java
index 016b0b9b..bbd0ce8a 100644
--- a/chapter14/src/main/java/com/seaofnodes/simple/node/ConstantNode.java
+++ b/chapter14/src/main/java/com/seaofnodes/simple/node/ConstantNode.java
@@ -18,7 +18,7 @@ import java.util.BitSet;
* The Constant's value is the value stored in it.
*/
public class ConstantNode extends Node {
- Type _con;
+ final Type _con;
public ConstantNode( Type type ) {
super(Parser.START);
_con = type;
diff --git a/chapter14/src/main/java/com/seaofnodes/simple/type/TypeMemPtr.java b/chapter14/src/main/java/com/seaofnodes/simple/type/TypeMemPtr.java
index 06fe2963..c93c3074 100644
--- a/chapter14/src/main/java/com/seaofnodes/simple/type/TypeMemPtr.java
+++ b/chapter14/src/main/java/com/seaofnodes/simple/type/TypeMemPtr.java
@@ -35,11 +35,11 @@ public class TypeMemPtr extends Type {
public static TypeMemPtr make(TypeStruct obj) { return make(obj, false); }
public TypeMemPtr make_from(TypeStruct obj) { return make(obj, _nil); }
- public static TypeMemPtr BOT = make(TypeStruct.BOT,true);
- public static TypeMemPtr TOP = BOT.dual();
- public static TypeMemPtr NULLPTR = make(TypeStruct.TOP,true);
- public static TypeMemPtr VOIDPTR = NULLPTR.dual(); // A bottom mix of not-null ptrs, like C's void* but not null
- public static TypeMemPtr TEST= make(TypeStruct.TEST,false);
+ public static final TypeMemPtr BOT = make(TypeStruct.BOT,true);
+ public static final TypeMemPtr TOP = BOT.dual();
+ public static final TypeMemPtr NULLPTR = make(TypeStruct.TOP,true);
+ public static final TypeMemPtr VOIDPTR = NULLPTR.dual(); // A bottom mix of not-null ptrs, like C's void* but not null
+ public static final TypeMemPtr TEST= make(TypeStruct.TEST,false);
public static void gather(ArrayList<Type> ts) { ts.add(NULLPTR); ts.add(BOT); ts.add(TEST); }
@Override