Improve behavior of DebugInfoEntryMinimal::getSubprogramName() introduced in r159512.

To fetch a subprogram name we should not only inspect the DIE for this subprogram, but optionally inspect
its specification, or its abstract origin (even if there is no inlining), or even specification of an abstract origin.

Reviewed by Benjamin Kramer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160365 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov
2012-07-17 15:28:35 +00:00
parent 4f0c69623c
commit 9d26b0ba06
6 changed files with 41 additions and 29 deletions

View File

@ -155,8 +155,10 @@ DILineInfo DWARFContext::getLineInfoForAddress(uint64_t address,
if (specifier.needs(DILineInfoSpecifier::FunctionName)) {
const DWARFDebugInfoEntryMinimal *function_die =
cu->getFunctionDIEForAddress(address);
if (function_die)
functionName = function_die->getSubprogramName(cu);
if (function_die) {
if (const char *name = function_die->getSubprogramName(cu))
functionName = name;
}
}
if (specifier.needs(DILineInfoSpecifier::FileLineInfo)) {
// Get the line table for this compile unit.