Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/typesystem/TypeCheckParser.java @ 8593:54e227b2e199
Refactored ParameterSpec constructors.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 01 Apr 2013 12:14:54 +0200 |
parents | a80bf36c6a1e |
children | 8a1115c92271 |
comparison
equal
deleted
inserted
replaced
8592:a80bf36c6a1e | 8593:54e227b2e199 |
---|---|
29 import javax.lang.model.type.*; | 29 import javax.lang.model.type.*; |
30 | 30 |
31 import com.oracle.truffle.api.codegen.*; | 31 import com.oracle.truffle.api.codegen.*; |
32 import com.oracle.truffle.codegen.processor.*; | 32 import com.oracle.truffle.codegen.processor.*; |
33 import com.oracle.truffle.codegen.processor.template.*; | 33 import com.oracle.truffle.codegen.processor.template.*; |
34 import com.oracle.truffle.codegen.processor.template.ParameterSpec.Cardinality; | |
35 | 34 |
36 class TypeCheckParser extends TypeSystemMethodParser<TypeCheckData> { | 35 class TypeCheckParser extends TypeSystemMethodParser<TypeCheckData> { |
37 | 36 |
38 public TypeCheckParser(ProcessorContext context, TypeSystemData typeSystem) { | 37 public TypeCheckParser(ProcessorContext context, TypeSystemData typeSystem) { |
39 super(context, typeSystem); | 38 super(context, typeSystem); |
44 TypeData targetType = findTypeByMethodName(method.getSimpleName().toString(), "is"); | 43 TypeData targetType = findTypeByMethodName(method.getSimpleName().toString(), "is"); |
45 if (targetType == null) { | 44 if (targetType == null) { |
46 return null; | 45 return null; |
47 } | 46 } |
48 List<ParameterSpec> specs = new ArrayList<>(); | 47 List<ParameterSpec> specs = new ArrayList<>(); |
49 specs.add(new ParameterSpec("value", getTypeSystem(), false, Cardinality.ONE, true)); | 48 ParameterSpec valueSpec = new ParameterSpec("value", getTypeSystem().getPrimitiveTypeMirrors()); |
50 ParameterSpec returnTypeSpec = new ParameterSpec("returnType", getContext().getType(boolean.class), false, true); | 49 valueSpec.setSignature(true); |
50 specs.add(valueSpec); | |
51 ParameterSpec returnTypeSpec = new ParameterSpec("returnType", getContext().getType(boolean.class)); | |
52 returnTypeSpec.setSignature(true); | |
51 MethodSpec spec = new MethodSpec(Collections.<TypeMirror> emptyList(), returnTypeSpec, specs); | 53 MethodSpec spec = new MethodSpec(Collections.<TypeMirror> emptyList(), returnTypeSpec, specs); |
52 return spec; | 54 return spec; |
53 } | 55 } |
54 | 56 |
55 @Override | 57 @Override |