summaryrefslogtreecommitdiff
path: root/src/main/java/com/seaofnodes/simple/node/StructNode.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-08-10 11:11:18 -0700
committerCliff Click <cliffc@acm.org>2026-10-08 16:52:27 -0700
commitd32f97238c903765dec4e9a9f3cbfa5fd12cded6 (patch)
treea5ac731801ef7066bab6359c4e85c2bdd20082a6 /src/main/java/com/seaofnodes/simple/node/StructNode.java
parentb5ebb2032aa04cf4506d533127d373d4cf5a25c6 (diff)
downloadSimple-linear.tar.gz
Simple-linear.zip
Chapter 25: Modules, Separate Compilation, and SSA Constructionlinear
Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki <jun784@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/main/java/com/seaofnodes/simple/node/StructNode.java')
-rw-r--r--src/main/java/com/seaofnodes/simple/node/StructNode.java47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/main/java/com/seaofnodes/simple/node/StructNode.java b/src/main/java/com/seaofnodes/simple/node/StructNode.java
deleted file mode 100644
index 78b20e9f..00000000
--- a/src/main/java/com/seaofnodes/simple/node/StructNode.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.seaofnodes.simple.node;
-
-import com.seaofnodes.print.ExprPrinter;
-
-import com.seaofnodes.simple.type.*;
-import com.seaofnodes.simple.util.SB;
-
-/**
- * Build a compound object
- */
-public class StructNode extends Node {
-
- public final TypeStruct _ts;
- public StructNode(TypeStruct ts) { _ts=ts; assert !ts._open; }
-
- @Override public String label() { return _ts==null ? "STRUCT?" : _ts.str(); }
-
- @Override
- protected ExprPrinter<Node> _print1(ExprPrinter<Node> p) {
- if( _ts==null ) return p.p("STRUCT?");
- p.p(_ts._name).p(" {");
- for( int i=0; i<nIns(); i++ ) {
- p.p(_ts._fields[i]._fname).p(":");
- p.p(in(i)==null ? Type.BOTTOM : in(i)._type);
- p.p("; ");
- }
- return p.unchar("; ").p("}");
- }
-
- @Override
- public TypeStruct compute() {
- if( _ts==null ) return TypeStruct.BOT;
- Field[] fs = new Field[_ts._fields.length];
- for( int i=0; i<fs.length; i++ )
- fs[i] = _ts._fields[i].makeFrom(in(i)==null ? Type.TOP : in(i)._type);
- return TypeStruct.make(_ts._name,false,fs);
- }
-
- @Override
- public Node idealize() { return null; }
-
- @Override
- public boolean eq(Node n) { return _ts == ((StructNode)n)._ts; }
-
- @Override
- int hash() { return _ts==null ? 0 : _ts.hashCode(); }
-}