Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/typesystem/TypeCastParser.java @ 8252:0905d796944a
Refactored codegen error model to make error redirection a lot easier.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 13 Mar 2013 19:58:28 +0100 |
parents | 703c09f8640c |
children | a80bf36c6a1e |
comparison
equal
deleted
inserted
replaced
8251:cb70ed101b5f | 8252:0905d796944a |
---|---|
39 super(context, typeSystem); | 39 super(context, typeSystem); |
40 } | 40 } |
41 | 41 |
42 @Override | 42 @Override |
43 public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { | 43 public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { |
44 TypeData targetType = findTypeByMethodName(method, mirror, "as"); | 44 TypeData targetType = findTypeByMethodName(method.getSimpleName().toString(), "as"); |
45 if (targetType == null) { | 45 if (targetType == null) { |
46 return null; | 46 return null; |
47 } | 47 } |
48 List<ParameterSpec> specs = new ArrayList<>(); | 48 List<ParameterSpec> specs = new ArrayList<>(); |
49 specs.add(new ParameterSpec("value", getTypeSystem(), false, Cardinality.ONE)); | 49 specs.add(new ParameterSpec("value", getTypeSystem(), false, Cardinality.ONE)); |
52 return spec; | 52 return spec; |
53 } | 53 } |
54 | 54 |
55 @Override | 55 @Override |
56 public TypeCastData create(TemplateMethod method) { | 56 public TypeCastData create(TemplateMethod method) { |
57 TypeData targetType = findTypeByMethodName(method.getMethod(), method.getMarkerAnnotation(), "as"); | 57 TypeData targetType = findTypeByMethodName(method, "as"); |
58 ActualParameter parameter = method.findParameter("valueValue"); | 58 ActualParameter parameter = method.findParameter("valueValue"); |
59 return new TypeCastData(method, parameter.getActualTypeData(getTypeSystem()), targetType); | 59 return new TypeCastData(method, parameter.getActualTypeData(getTypeSystem()), targetType); |
60 } | 60 } |
61 | 61 |
62 @Override | 62 @Override |