forked from OSchip/llvm-project
parent
9e7e4b5d85
commit
0a9e837b6f
|
@ -1402,6 +1402,23 @@ DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) {
|
|||
|
||||
break;
|
||||
}
|
||||
case DW_TAG_subroutine_type: {
|
||||
// Add prototype flag.
|
||||
Ty->AddUInt(DW_AT_prototyped, DW_FORM_flag, 1);
|
||||
// Add return type.
|
||||
Ty->AddDIEntry(DW_AT_type, DW_FORM_ref4,
|
||||
NewType(Context, cast<TypeDesc>(Elements[0]), Unit));
|
||||
|
||||
// Add arguments.
|
||||
for(unsigned i = 1, N = Elements.size(); i < N; ++i) {
|
||||
DIE *Arg = new DIE(DW_TAG_formal_parameter);
|
||||
Arg->AddDIEntry(DW_AT_type, DW_FORM_ref4,
|
||||
NewType(Context, cast<TypeDesc>(Elements[i]), Unit));
|
||||
Ty->AddChild(Arg);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -493,7 +493,8 @@ DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) {
|
|||
case DW_TAG_structure_type:
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_vector_type: return new CompositeTypeDesc(Tag);
|
||||
case DW_TAG_vector_type:
|
||||
case DW_TAG_subroutine_type: return new CompositeTypeDesc(Tag);
|
||||
case DW_TAG_subrange_type: return new SubrangeDesc();
|
||||
case DW_TAG_enumerator: return new EnumeratorDesc();
|
||||
case DW_TAG_return_variable:
|
||||
|
@ -831,6 +832,7 @@ bool CompositeTypeDesc::classof(const DebugInfoDesc *D) {
|
|||
case DW_TAG_union_type:
|
||||
case DW_TAG_enumeration_type:
|
||||
case DW_TAG_vector_type:
|
||||
case DW_TAG_subroutine_type:
|
||||
return true;
|
||||
default: break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue