changeset 13994:989f58d6a0ca

Truffle: Added API for Node.getKind().
author Christian Humer <christian.humer@gmail.com>
date Fri, 21 Feb 2014 02:24:03 +0100
parents fcc40370f78d
children e455fc531ec2
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java	Thu Feb 20 13:59:18 2014 +0100
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java	Fri Feb 21 02:24:03 2014 +0100
@@ -82,6 +82,14 @@
         this.sourceSection = section;
     }
 
+    public Kind getKind() {
+        NodeInfo info = getClass().getAnnotation(NodeInfo.class);
+        if (info != null) {
+            return info.kind();
+        }
+        return Kind.SPECIALIZED;
+    }
+
     /**
      * Clears any previously assigned guest language source code from this node.
      */