Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/TruffleTypes.java @ 9779:0e4db5ee0695
Added support for the kind field in @NodeInfo for the source code generation.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 21 May 2013 19:20:04 +0200 |
parents | 52fde777a605 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/TruffleTypes.java Tue May 21 19:19:34 2013 +0200 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/TruffleTypes.java Tue May 21 19:20:04 2013 +0200 @@ -26,7 +26,7 @@ import javax.lang.model.element.*; import javax.lang.model.type.*; -import javax.tools.Diagnostic.*; +import javax.tools.Diagnostic.Kind; import com.oracle.truffle.api.*; import com.oracle.truffle.api.frame.*; @@ -47,6 +47,8 @@ private final TypeMirror invalidAssumption; private final DeclaredType childAnnotation; private final DeclaredType childrenAnnotation; + private final DeclaredType nodeInfoAnnotation; + private final DeclaredType nodeInfoKind; private final TypeMirror compilerDirectives; private final TypeMirror compilerAsserts; @@ -63,6 +65,12 @@ compilerAsserts = getRequired(context, CompilerAsserts.class); assumption = getRequired(context, Assumption.class); invalidAssumption = getRequired(context, InvalidAssumptionException.class); + nodeInfoAnnotation = getRequired(context, NodeInfo.class); + nodeInfoKind = getRequired(context, NodeInfo.Kind.class); + } + + public DeclaredType getNodeInfoAnnotation() { + return nodeInfoAnnotation; } public boolean verify(ProcessorContext context, Element element, AnnotationMirror mirror) { @@ -77,6 +85,10 @@ return false; } + public DeclaredType getNodeInfoKind() { + return nodeInfoKind; + } + private DeclaredType getRequired(ProcessorContext context, Class clazz) { TypeMirror type = context.getType(clazz); if (type == null) {