diff options
author | Adrian Prantl <aprantl@apple.com> | 2014-02-25 19:38:07 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2014-02-25 19:38:07 +0000 |
commit | 70ff4f70036de0ec02913a70d037500f9c193865 (patch) | |
tree | 24d091fbf35f4f42590b07f2a4bd0993dedd0fb3 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | c5d1689b45f04f656528985801711f64f6911a15 (diff) | |
download | bcm5719-llvm-70ff4f70036de0ec02913a70d037500f9c193865.tar.gz bcm5719-llvm-70ff4f70036de0ec02913a70d037500f9c193865.zip |
Debug info: Support variadic functions.
Variadic functions have an unspecified parameter tag after the last
argument. In IR this is represented as an unspecified parameter in the
subroutine type.
Paired commit with CFE.
rdar://problem/13690847
llvm-svn: 202184
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2425948ae9a..f9ee2705a39 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -582,7 +582,7 @@ DIE *DwarfDebug::createScopeChildrenDIE(DwarfCompileUnit *TheCU, DIE *ObjectPointer = NULL; // Collect arguments for current function. - if (LScopes.isCurrentFunctionScope(Scope)) + if (LScopes.isCurrentFunctionScope(Scope)) { for (unsigned i = 0, N = CurrentFnArguments.size(); i < N; ++i) if (DbgVariable *ArgDV = CurrentFnArguments[i]) if (DIE *Arg = @@ -592,6 +592,16 @@ DIE *DwarfDebug::createScopeChildrenDIE(DwarfCompileUnit *TheCU, ObjectPointer = Arg; } + // Create the unspecified parameter that marks a function as variadic. + DISubprogram SP(Scope->getScopeNode()); + assert(SP.Verify()); + DIArray FnArgs = SP.getType().getTypeArray(); + if (FnArgs.getElement(FnArgs.getNumElements()-1).isUnspecifiedParameter()) { + DIE *Ellipsis = new DIE(dwarf::DW_TAG_unspecified_parameters); + Children.push_back(Ellipsis); + } + } + // Collect lexical scope children first. const SmallVectorImpl<DbgVariable *> &Variables = ScopeVariables.lookup(Scope); |