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);
}
}
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);
}
}
}
}
Aggregations