Search in sources :

Example 1 with LLVMInteropType

use of com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType in project sulong by graalvm.

the class BasicNodeFactory method registerSourceType.

@Override
public LLVMExpressionNode registerSourceType(FrameSlot valueSlot, LLVMSourceType type) {
    LLVMSourceType actual = type.getActualType();
    if (actual instanceof LLVMSourcePointerType) {
        // only pointer types can contain foreign values
        LLVMSourceType base = ((LLVMSourcePointerType) actual).getBaseType();
        LLVMInteropType interopType = LLVMInteropType.fromSourceType(base);
        if (interopType != null) {
            return new LLVMSetInteropTypeNode(valueSlot, interopType);
        }
    }
    return null;
}
Also used : LLVMSetInteropTypeNode(com.oracle.truffle.llvm.nodes.vars.LLVMSetInteropTypeNode) LLVMSourcePointerType(com.oracle.truffle.llvm.runtime.debug.LLVMSourcePointerType) LLVMSourceType(com.oracle.truffle.llvm.runtime.debug.LLVMSourceType) LLVMInteropType(com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType)

Aggregations

LLVMSetInteropTypeNode (com.oracle.truffle.llvm.nodes.vars.LLVMSetInteropTypeNode)1 LLVMSourcePointerType (com.oracle.truffle.llvm.runtime.debug.LLVMSourcePointerType)1 LLVMSourceType (com.oracle.truffle.llvm.runtime.debug.LLVMSourceType)1 LLVMInteropType (com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropType)1