diff options
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 3ca968672c..f77871e8ca 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -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; } } |