Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/typesystem/TypeCheckParser.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, "is"); | 44 TypeData targetType = findTypeByMethodName(method.getSimpleName().toString(), "is"); |
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 TypeCheckData create(TemplateMethod method) { | 56 public TypeCheckData create(TemplateMethod method) { |
57 TypeData checkedType = findTypeByMethodName(method.getMethod(), method.getMarkerAnnotation(), "is"); | 57 TypeData checkedType = findTypeByMethodName(method, "is"); |
58 assert checkedType != null; | 58 assert checkedType != null; |
59 ActualParameter parameter = method.findParameter("valueValue"); | 59 ActualParameter parameter = method.findParameter("valueValue"); |
60 assert parameter != null; | 60 assert parameter != null; |
61 return new TypeCheckData(method, checkedType, parameter.getActualTypeData(getTypeSystem())); | 61 return new TypeCheckData(method, checkedType, parameter.getActualTypeData(getTypeSystem())); |
62 } | 62 } |