Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/TemplateMethodParser.java @ 8242:ac4e8c16ffdf
Added new codegen api classes NodeId, NodeClass to codegen along with some refactorings.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 04 Mar 2013 15:14:11 +0100 |
parents | 6b74ffe38183 |
children | 703c09f8640c |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/TemplateMethodParser.java Mon Mar 04 15:13:25 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/TemplateMethodParser.java Mon Mar 04 15:14:11 2013 +0100 @@ -31,6 +31,7 @@ import javax.lang.model.type.*; import javax.lang.model.util.*; +import com.oracle.truffle.api.codegen.*; import com.oracle.truffle.codegen.processor.*; import com.oracle.truffle.codegen.processor.template.ParameterSpec.Cardinality; @@ -149,8 +150,15 @@ } return null; } + + String id = method.getSimpleName().toString(); + AnnotationMirror idAnnotation = Utils.findAnnotationMirror(context.getEnvironment(), method, NodeId.class); + if (idAnnotation != null) { + id = Utils.getAnnotationValueString(idAnnotation, "value"); + } + ActualParameter[] paramMirrors = parameters.toArray(new ActualParameter[parameters.size()]); - return create(new TemplateMethod(template, methodSpecification, method, annotation, returnTypeMirror, paramMirrors)); + return create(new TemplateMethod(id, template, methodSpecification, method, annotation, returnTypeMirror, paramMirrors)); } private List<ActualParameter> parseParameters(ExecutableElement method, List<ParameterSpec> parameterSpecs) {