diff options
author | Eric Christopher <echristo@apple.com> | 2011-10-21 23:30:10 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-10-21 23:30:10 +0000 |
commit | 4b4beb2fe70f7da8bb9fe7b81ecbe6a2c9c6e612 (patch) | |
tree | 3ba5871eec38ac85fc142826be895b4fb7d96910 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 0a92de06f013da0dccdd10c40f44433c16f2725f (diff) | |
download | bcm5719-llvm-4b4beb2fe70f7da8bb9fe7b81ecbe6a2c9c6e612.tar.gz bcm5719-llvm-4b4beb2fe70f7da8bb9fe7b81ecbe6a2c9c6e612.zip |
Fix PR11073 by adding the argument type information to the decl we construct
for the function type. Update a testcase accordingly.
Patch initially by Anders Waldenborg!
llvm-svn: 142700
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 13 |
1 files changed, 10 insertions, 3 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); } |