Search in sources :

Example 1 with InputType

use of org.graalvm.compiler.nodeinfo.InputType in project graal by oracle.

the class NodeIntrinsicVerifier method checkInputType.

private void checkInputType(TypeElement nodeClass, TypeMirror returnType, Element element, AnnotationMirror annotation) {
    InputType inputType = getInputType(returnType, element, annotation);
    if (inputType != InputType.Value) {
        boolean allowed = false;
        InputType[] allowedTypes = nodeClass.getAnnotation(NodeInfo.class).allowedUsageTypes();
        for (InputType allowedType : allowedTypes) {
            if (inputType == allowedType) {
                allowed = true;
                break;
            }
        }
        if (!allowed) {
            env.getMessager().printMessage(Kind.ERROR, String.format("@NodeIntrinsic returns input type %s, but only %s is allowed.", inputType, Arrays.toString(allowedTypes)), element, annotation);
        }
    }
}
Also used : InputType(org.graalvm.compiler.nodeinfo.InputType) NodeInfo(org.graalvm.compiler.nodeinfo.NodeInfo)

Aggregations

InputType (org.graalvm.compiler.nodeinfo.InputType)1 NodeInfo (org.graalvm.compiler.nodeinfo.NodeInfo)1