summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-06-20 19:41:06 +0000
committerJim Laskey <jlaskey@mac.com>2006-06-20 19:41:06 +0000
commit650f609734b0f948be89376acfebb56249990619 (patch)
tree3bacbcf68278310a2a1d63e03c7bac1030df35cc /lib/CodeGen
parent6cee033a80454200589229a4ded3b052f9864f6b (diff)
downloadllvm-650f609734b0f948be89376acfebb56249990619.tar.gz
llvm-650f609734b0f948be89376acfebb56249990619.tar.bz2
llvm-650f609734b0f948be89376acfebb56249990619.tar.xz
Add support for function types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp17
-rw-r--r--lib/CodeGen/MachineDebugInfo.cpp4
2 files changed, 20 insertions, 1 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;
}
}
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp
index 706beb8a8c..c1aac50573 100644
--- a/lib/CodeGen/MachineDebugInfo.cpp
+++ b/lib/CodeGen/MachineDebugInfo.cpp
@@ -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;
}