Search in sources :

Example 1 with MDAttachment

use of com.oracle.truffle.llvm.parser.metadata.MDAttachment in project sulong by graalvm.

the class MDUpgrade method attachSymbol.

private void attachSymbol(MetadataAttachmentHolder container, MDBaseNode ref) {
    if (!container.hasAttachedMetadata() || container.getMetadataAttachment(MDKind.DBG_NAME) == null) {
        final MDAttachment dbg = MDAttachment.create(dbgKind, ref);
        container.attachMetadata(dbg);
    }
}
Also used : MDAttachment(com.oracle.truffle.llvm.parser.metadata.MDAttachment)

Example 2 with MDAttachment

use of com.oracle.truffle.llvm.parser.metadata.MDAttachment in project sulong by graalvm.

the class Metadata method createAttachment.

private void createAttachment(long[] args, boolean isGlobal) {
    if (args.length > 0) {
        final int offset = args.length % 2;
        final int targetIndex = (int) args[0];
        for (int i = offset; i < args.length; i += 2) {
            final MDKind kind = metadata.getKind(args[i]);
            final MDAttachment attachment = MDAttachment.create(kind, args[i + 1], metadata);
            if (isGlobal) {
                scope.attachGlobalMetadata(targetIndex, attachment);
            } else if (offset == 0) {
                scope.attachFunctionMetadata(attachment);
            } else {
                scope.attachInstructionMetadata(targetIndex, attachment);
            }
        }
    }
}
Also used : MDKind(com.oracle.truffle.llvm.parser.metadata.MDKind) MDAttachment(com.oracle.truffle.llvm.parser.metadata.MDAttachment)

Aggregations

MDAttachment (com.oracle.truffle.llvm.parser.metadata.MDAttachment)2 MDKind (com.oracle.truffle.llvm.parser.metadata.MDKind)1