diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java @ 18761:a665483c3881

Truffle-DSL: new node layout implementation.
author Christian Humer <christian.humer@gmail.com>
date Mon, 29 Dec 2014 23:38:54 +0100
parents 58eb9bbb60c4
children ae81dd154fb6
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java	Mon Dec 29 23:38:50 2014 +0100
+++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java	Mon Dec 29 23:38:54 2014 +0100
@@ -27,6 +27,7 @@
 import javax.lang.model.element.*;
 import javax.lang.model.type.*;
 
+import com.oracle.truffle.api.dsl.internal.*;
 import com.oracle.truffle.dsl.processor.*;
 import com.oracle.truffle.dsl.processor.java.*;
 
@@ -42,10 +43,18 @@
     private List<TypeCheckData> checks;
 
     private TypeMirror genericType;
+    private TypeData booleanType;
     private TypeData voidType;
 
-    public TypeSystemData(ProcessorContext context, TypeElement templateType, AnnotationMirror annotation) {
-        super(context, templateType, null, annotation);
+    private DSLOptions options;
+
+    public TypeSystemData(ProcessorContext context, TypeElement templateType, AnnotationMirror annotation, DSLOptions options) {
+        super(context, templateType, annotation);
+        this.options = options;
+    }
+
+    public DSLOptions getOptions() {
+        return options;
     }
 
     @Override
@@ -196,6 +205,18 @@
         return null;
     }
 
+    public boolean hasImplicitSourceTypes(TypeData targetType) {
+        if (getImplicitCasts() == null) {
+            return false;
+        }
+        for (ImplicitCastData cast : getImplicitCasts()) {
+            if (cast.getTargetType() == targetType) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     public List<TypeData> lookupSourceTypes(TypeData type) {
         List<TypeData> sourceTypes = new ArrayList<>();
         sourceTypes.add(type);
@@ -210,4 +231,12 @@
         return sourceTypes;
     }
 
+    public TypeData getBooleanType() {
+        return booleanType;
+    }
+
+    public void setBooleanType(TypeData booleanType) {
+        this.booleanType = booleanType;
+    }
+
 }