Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/GenericParser.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 | ce6e8672f798 |
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.*; | |
35 | 34 |
36 public class GenericParser extends MethodParser<SpecializationData> { | 35 public class GenericParser extends MethodParser<SpecializationData> { |
37 | 36 |
38 public GenericParser(ProcessorContext context, NodeData node) { | 37 public GenericParser(ProcessorContext context, NodeData node) { |
39 super(context, node); | 38 super(context, node); |
49 List<ExecutableTypeData> execTypes = nodeData.findGenericExecutableTypes(getContext()); | 48 List<ExecutableTypeData> execTypes = nodeData.findGenericExecutableTypes(getContext()); |
50 List<TypeMirror> types = new ArrayList<>(); | 49 List<TypeMirror> types = new ArrayList<>(); |
51 for (ExecutableTypeData type : execTypes) { | 50 for (ExecutableTypeData type : execTypes) { |
52 types.add(type.getType().getPrimitiveType()); | 51 types.add(type.getType().getPrimitiveType()); |
53 } | 52 } |
54 return new ParameterSpec(valueName, types, false, Cardinality.ONE, true); | 53 ParameterSpec spec = new ParameterSpec(valueName, types); |
54 spec.setSignature(true); | |
55 return spec; | |
55 } | 56 } |
56 | 57 |
57 @Override | 58 @Override |
58 protected ParameterSpec createReturnParameterSpec() { | 59 protected ParameterSpec createReturnParameterSpec() { |
59 return super.createValueParameterSpec("returnValue", getNode(), false); | 60 return super.createValueParameterSpec("returnValue", getNode(), false); |