summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp13
-rw-r--r--clang/test/CodeGen/debug-info-args.c9
-rw-r--r--clang/test/CodeGenCXX/debug-info-fn-template.cpp2
3 files changed, 20 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 8191f021da4..7036682eb56 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -298,12 +298,19 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
// Emit subprogram debug descriptor.
if (CGDebugInfo *DI = getDebugInfo()) {
- // FIXME: what is going on here and why does it ignore all these
- // interesting type properties?
+ unsigned NumArgs = 0;
+ QualType *ArgsArray = new QualType[Args.size()];
+ for (FunctionArgList::const_iterator i = Args.begin(), e = Args.end();
+ i != e; ++i) {
+ ArgsArray[NumArgs++] = (*i)->getType();
+ }
+
QualType FnType =
- getContext().getFunctionType(RetTy, 0, 0,
+ getContext().getFunctionType(RetTy, ArgsArray, NumArgs,
FunctionProtoType::ExtProtoInfo());
+ delete ArgsArray;
+
DI->setLocation(StartLoc);
DI->EmitFunctionStart(GD, FnType, CurFn, Builder);
}
diff --git a/clang/test/CodeGen/debug-info-args.c b/clang/test/CodeGen/debug-info-args.c
new file mode 100644
index 00000000000..1d4ea10f17d
--- /dev/null
+++ b/clang/test/CodeGen/debug-info-args.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm -g %s | FileCheck %s
+
+int somefunc(char *x, int y, double z) {
+
+ // CHECK: {{.*metadata !8, i32 0, i32 0}.*DW_TAG_subroutine_type}}
+ // CHECK: {{!8 = .*metadata ![^,]*, metadata ![^,]*, metadata ![^,]*, metadata ![^,]*}}
+
+ return y;
+}
diff --git a/clang/test/CodeGenCXX/debug-info-fn-template.cpp b/clang/test/CodeGenCXX/debug-info-fn-template.cpp
index c8291af852d..bef9fe14402 100644
--- a/clang/test/CodeGenCXX/debug-info-fn-template.cpp
+++ b/clang/test/CodeGenCXX/debug-info-fn-template.cpp
@@ -10,6 +10,6 @@ T fx(XF<T> xi) {
return xi.member;
}
-//CHECK: DW_TAG_template_type_parameter
//CHECK: XF<int>
+//CHECK: DW_TAG_template_type_parameter
template int fx(XF<int>);
OpenPOWER on IntegriCloud