Search in sources :

Example 1 with ConstantPtrtoint

use of org.robovm.compiler.llvm.ConstantPtrtoint in project robovm by robovm.

the class Types method offsetof.

public static Constant offsetof(AggregateType type, int... idx) {
    int[] i = new int[idx.length + 1];
    i[0] = 0;
    System.arraycopy(idx, 0, i, 1, idx.length);
    return new ConstantPtrtoint(new ConstantGetelementptr(new NullConstant(new PointerType(type)), i), I32);
}
Also used : NullConstant(org.robovm.compiler.llvm.NullConstant) ConstantPtrtoint(org.robovm.compiler.llvm.ConstantPtrtoint) PointerType(org.robovm.compiler.llvm.PointerType) ConstantGetelementptr(org.robovm.compiler.llvm.ConstantGetelementptr)

Aggregations

ConstantGetelementptr (org.robovm.compiler.llvm.ConstantGetelementptr)1 ConstantPtrtoint (org.robovm.compiler.llvm.ConstantPtrtoint)1 NullConstant (org.robovm.compiler.llvm.NullConstant)1 PointerType (org.robovm.compiler.llvm.PointerType)1