changeset 16209:dc1f9c606f36

non-adding factory methods in LogicConstantNode
author Lukas Stadler <lukas.stadler@oracle.com>
date Wed, 25 Jun 2014 11:20:53 +0200
parents e73e293c8a65
children 6beb6da182fc
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LogicConstantNode.java
diffstat 1 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LogicConstantNode.java	Wed Jun 25 11:20:53 2014 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LogicConstantNode.java	Wed Jun 25 11:20:53 2014 +0200
@@ -40,7 +40,7 @@
 
     /**
      * Returns a node for a boolean constant.
-     * 
+     *
      * @param v the boolean value for which to create the instruction
      * @param graph
      * @return a node representing the boolean
@@ -50,6 +50,16 @@
     }
 
     /**
+     * Returns a node for a boolean constant.
+     *
+     * @param v the boolean value for which to create the instruction
+     * @return a node representing the boolean
+     */
+    public static LogicConstantNode forBoolean(boolean v) {
+        return new LogicConstantNode(v);
+    }
+
+    /**
      * Gets a constant for {@code true}.
      */
     public static LogicConstantNode tautology(Graph graph) {
@@ -63,6 +73,20 @@
         return forBoolean(false, graph);
     }
 
+    /**
+     * Gets a constant for {@code true}.
+     */
+    public static LogicConstantNode tautology() {
+        return forBoolean(true);
+    }
+
+    /**
+     * Gets a constant for {@code false}.
+     */
+    public static LogicConstantNode contradiction() {
+        return forBoolean(false);
+    }
+
     public boolean getValue() {
         return value;
     }