Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/CreateCastParser.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 | 62c43fcf5be2 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/CreateCastParser.java Tue Apr 14 22:12:03 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/CreateCastParser.java Tue Apr 14 15:12:48 2015 +0200 @@ -59,7 +59,7 @@ baseType = foundChild.getOriginalType(); } - MethodSpec spec = new MethodSpec(new InheritsParameterSpec("child", baseType)); + MethodSpec spec = new MethodSpec(new ParameterSpec("child", baseType)); addDefaultFieldMethodSpec(spec); ParameterSpec childSpec = new ParameterSpec("castedChild", baseType); childSpec.setSignature(true); @@ -96,22 +96,4 @@ return cast; } - private static class InheritsParameterSpec extends ParameterSpec { - - public InheritsParameterSpec(String name, TypeMirror... allowedTypes) { - super(name, Arrays.asList(allowedTypes), null); - } - - @Override - public boolean matches(VariableElement variable) { - boolean found = false; - for (TypeMirror specType : getAllowedTypes()) { - if (ElementUtils.isAssignable(variable.asType(), specType)) { - found = true; - break; - } - } - return found; - } - } }