use of com.oracle.truffle.llvm.parser.model.attributes.Attribute in project sulong by graalvm.
the class LLVMBitcodeInstructionVisitor method capsuleAddressByValue.
private LLVMExpressionNode capsuleAddressByValue(LLVMExpressionNode child, Type type, AttributesGroup paramAttr) {
final Type pointee = ((PointerType) type).getPointeeType();
final int size = runtime.getContext().getByteSize(pointee);
int alignment = runtime.getContext().getByteAlignment(pointee);
for (Attribute attr : paramAttr.getAttributes()) {
if (attr instanceof Attribute.KnownIntegerValueAttribute && ((Attribute.KnownIntegerValueAttribute) attr).getAttr() == Attribute.Kind.ALIGN) {
alignment = ((Attribute.KnownIntegerValueAttribute) attr).getValue();
}
}
return nodeFactory.createVarArgCompoundValue(runtime, size, alignment, child);
}
Aggregations