use of com.oracle.truffle.llvm.parser.records.DwTagRecord in project sulong by graalvm.
the class Metadata method createOldNode.
private void createOldNode(long[] args) {
if (ParseUtil.isInteger(args, ARGINDEX_IDENT, this) && DwTagRecord.isDwarfDescriptor(ParseUtil.asLong(args, ARGINDEX_IDENT, this))) {
// this is a debug information descriptor as described in
// http://releases.llvm.org/3.2/docs/SourceLevelDebugging.html#debug_info_descriptors
final int ident = ParseUtil.asInt(args, ARGINDEX_IDENT, this);
final DwTagRecord record = DwTagRecord.decode(ident);
switch(record) {
case DW_TAG_COMPILE_UNIT:
metadata.add(MDCompileUnit.create32(args, this));
break;
case DW_TAG_FILE_TYPE:
metadata.add(MDFile.create32(args, this));
break;
case DW_TAG_CONSTANT:
case DW_TAG_VARIABLE:
// descriptor for a global variable or constant
metadata.add(MDGlobalVariable.create32(args, this));
break;
case DW_TAG_SUBPROGRAM:
metadata.add(MDSubprogram.create32(args, this));
break;
case DW_TAG_LEXICAL_BLOCK:
metadata.add(createLexicalBlock(args));
break;
case DW_TAG_BASE_TYPE:
metadata.add(MDBasicType.create32(args, this));
break;
case DW_TAG_FORMAL_PARAMETER:
case DW_TAG_MEMBER:
case DW_TAG_POINTER_TYPE:
case DW_TAG_REFERENCE_TYPE:
case DW_TAG_TYPEDEF:
case DW_TAG_CONST_TYPE:
case DW_TAG_VOLATILE_TYPE:
case DW_TAG_RESTRICT_TYPE:
case DW_TAG_FRIEND:
metadata.add(MDDerivedType.create32(args, this));
break;
case DW_TAG_CLASS_TYPE:
case DW_TAG_ARRAY_TYPE:
case DW_TAG_ENUMERATION_TYPE:
case DW_TAG_STRUCTURE_TYPE:
case DW_TAG_UNION_TYPE:
case DW_TAG_VECTOR_TYPE:
case DW_TAG_INHERITANCE:
case DW_TAG_SUBROUTINE_TYPE:
{
final MDCompositeType type = MDCompositeType.create32(args, this);
metadata.add(type);
compositeTypes.add(type);
break;
}
case DW_TAG_SUBRANGE_TYPE:
metadata.add(MDSubrange.create32(args, this));
break;
case DW_TAG_ENUMERATOR:
metadata.add(MDEnumerator.create32(args, this));
break;
case DW_TAG_AUTO_VARIABLE:
case DW_TAG_ARG_VARIABLE:
case DW_TAG_RETURN_VARIABLE:
{
final MDLocalVariable md = MDLocalVariable.create32(args, this);
metadata.registerLocal(md);
metadata.add(md);
break;
}
case DW_TAG_UNKNOWN:
metadata.add(MDNode.create32(args, this));
break;
case DW_TAG_TEMPLATE_TYPE_PARAMETER:
metadata.add(MDTemplateTypeParameter.create32(args, this));
break;
case DW_TAG_TEMPLATE_VALUE_PARAMETER:
metadata.add(MDTemplateValue.create32(args, this));
break;
case DW_TAG_NAMESPACE:
metadata.add(MDNamespace.create32(args, this));
break;
default:
metadata.add(MDNode.create32(args, this));
}
} else {
metadata.add(MDNode.create32(args, this));
}
}
Aggregations