Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/Parameter.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 | b31b2f289e7d |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/Parameter.java Tue Apr 14 22:12:03 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/Parameter.java Tue Apr 14 15:12:48 2015 +0200 @@ -28,19 +28,17 @@ public final class Parameter { private final ParameterSpec specification; - private TypeData typeSystemType; private TemplateMethod method; private String localName; private final int specificationVarArgsIndex; private final int typeVarArgsIndex; - private final VariableElement variableElement; + private final TypeMirror type; public Parameter(ParameterSpec specification, VariableElement variableElement, int specificationVarArgsIndex, int typeVarArgsIndex) { this.specification = specification; this.variableElement = variableElement; - this.typeSystemType = null; - + this.type = variableElement.asType(); this.specificationVarArgsIndex = specificationVarArgsIndex; String valueName = specification.getName() + "Value"; @@ -51,22 +49,22 @@ this.localName = valueName; } - public Parameter(ParameterSpec specification, TypeData actualType, VariableElement variableElement, int specificationIndex, int varArgsIndex) { - this(specification, variableElement, specificationIndex, varArgsIndex); - this.typeSystemType = actualType; - } - - public Parameter(Parameter parameter, TypeData otherType) { - this(parameter.specification, otherType, parameter.variableElement, parameter.specificationVarArgsIndex, parameter.typeVarArgsIndex); - } - public Parameter(Parameter parameter) { this.specification = parameter.specification; - this.typeSystemType = parameter.typeSystemType; this.specificationVarArgsIndex = parameter.specificationVarArgsIndex; this.localName = parameter.localName; this.typeVarArgsIndex = parameter.typeVarArgsIndex; this.variableElement = parameter.variableElement; + this.type = parameter.type; + } + + public Parameter(Parameter parameter, TypeMirror newType) { + this.specification = parameter.specification; + this.specificationVarArgsIndex = parameter.specificationVarArgsIndex; + this.localName = parameter.localName; + this.typeVarArgsIndex = parameter.typeVarArgsIndex; + this.variableElement = parameter.variableElement; + this.type = newType; } public void setLocalName(String localName) { @@ -102,11 +100,7 @@ } public TypeMirror getType() { - return variableElement.asType(); - } - - public TypeData getTypeSystemType() { - return typeSystemType; + return type; } public boolean isTypeVarArgs() {