Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeData.java @ 11545:2fb276f5e3e9
Truffle-DSL: implemented implicit casts.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 06 Sep 2013 16:16:40 +0200 |
parents | a9cb98ff8fd9 |
children | ba6593e52d22 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeData.java Fri Sep 06 16:11:15 2013 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeData.java Fri Sep 06 16:16:40 2013 +0200 @@ -32,7 +32,7 @@ import com.oracle.truffle.dsl.processor.template.*; import com.oracle.truffle.dsl.processor.typesystem.*; -public class NodeData extends Template { +public class NodeData extends Template implements Comparable<NodeData> { private final String nodeId; private NodeData declaringNode; @@ -90,6 +90,15 @@ return false; } + public boolean needsImplicitCast(ProcessorContext context) { + for (NodeChildData child : getChildren()) { + if (child.needsImplicitCast(context)) { + return true; + } + } + return false; + } + public int getPolymorphicDepth() { return polymorphicDepth; } @@ -574,4 +583,7 @@ return null; } + public int compareTo(NodeData o) { + return getNodeId().compareTo(o.getNodeId()); + } }