Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeCheckParser.java @ 20938:18c0f02fa4d2
Truffle-DSL: make type systems optional.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 15:12:48 +0200 |
parents | 3ea386a1036f |
children |
comparison
equal
deleted
inserted
replaced
20937:37ea76052733 | 20938:18c0f02fa4d2 |
---|---|
23 package com.oracle.truffle.dsl.processor.parser; | 23 package com.oracle.truffle.dsl.processor.parser; |
24 | 24 |
25 import java.lang.annotation.*; | 25 import java.lang.annotation.*; |
26 | 26 |
27 import javax.lang.model.element.*; | 27 import javax.lang.model.element.*; |
28 import javax.lang.model.type.*; | |
28 | 29 |
29 import com.oracle.truffle.api.dsl.*; | 30 import com.oracle.truffle.api.dsl.*; |
30 import com.oracle.truffle.dsl.processor.*; | 31 import com.oracle.truffle.dsl.processor.*; |
31 import com.oracle.truffle.dsl.processor.model.*; | 32 import com.oracle.truffle.dsl.processor.model.*; |
32 | 33 |
37 } | 38 } |
38 | 39 |
39 @Override | 40 @Override |
40 public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { | 41 public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { |
41 MethodSpec spec = new MethodSpec(new ParameterSpec("returnType", getContext().getType(boolean.class))); | 42 MethodSpec spec = new MethodSpec(new ParameterSpec("returnType", getContext().getType(boolean.class))); |
42 spec.addRequired(new ParameterSpec("value", getTypeSystem().getGenericType())); | 43 spec.addRequired(new ParameterSpec("value", getContext().getType(Object.class))); |
43 return spec; | 44 return spec; |
44 } | 45 } |
45 | 46 |
46 @Override | 47 @Override |
47 public TypeCheckData create(TemplateMethod method, boolean invalid) { | 48 public TypeCheckData create(TemplateMethod method, boolean invalid) { |
48 TypeData targetType = resolveCastOrCheck(method); | 49 TypeMirror targetType = resolveCastOrCheck(method); |
49 return new TypeCheckData(method, targetType, targetType); | 50 return new TypeCheckData(method, targetType, targetType); |
50 } | 51 } |
51 | 52 |
52 @Override | 53 @Override |
53 public Class<? extends Annotation> getAnnotationType() { | 54 public Class<? extends Annotation> getAnnotationType() { |