summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-05-17 00:07:48 +0000
committerAlexey Samsonov <samsonov@google.com>2014-05-17 00:07:48 +0000
commitcd01472a9ba70cc946511ccf483c49ee3f691a94 (patch)
tree7fec73d028ff373e3b559fc90e9742066e08d901 /llvm/lib
parent8d2a43e9beb58c4142ef5e9421017aec8082021c (diff)
downloadbcm5719-llvm-cd01472a9ba70cc946511ccf483c49ee3f691a94.tar.gz
bcm5719-llvm-cd01472a9ba70cc946511ccf483c49ee3f691a94.zip
[DWARF parser] Teach DIContext to fetch short (non-linkage) function names for a given address.
Change --functions option in llvm-symbolizer tool to accept values "none", "short" or "linkage". Update the tests and docs accordingly. llvm-svn: 209050
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
index d2b529346fb..b811ed70644 100644
--- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
@@ -277,13 +277,15 @@ DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U,
FunctionNameKind Kind) const {
if (!isSubroutineDIE() || Kind == FunctionNameKind::None)
return nullptr;
- // Try to get mangled name if possible.
- if (const char *name =
- getAttributeValueAsString(U, DW_AT_MIPS_linkage_name, nullptr))
- return name;
- if (const char *name = getAttributeValueAsString(U, DW_AT_linkage_name,
- nullptr))
- return name;
+ // Try to get mangled name only if it was asked for.
+ if (Kind == FunctionNameKind::LinkageName) {
+ if (const char *name =
+ getAttributeValueAsString(U, DW_AT_MIPS_linkage_name, nullptr))
+ return name;
+ if (const char *name =
+ getAttributeValueAsString(U, DW_AT_linkage_name, nullptr))
+ return name;
+ }
if (const char *name = getAttributeValueAsString(U, DW_AT_name, nullptr))
return name;
// Try to get name from specification DIE.
OpenPOWER on IntegriCloud