X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FDebugInfo%2FDWARFDebugInfoEntry.cpp;h=2e7a54aeb858b7c7001e3136829ad003433f7d9f;hb=79f9f85c04e1ed29670ed7a87df879bb5b42a0f1;hp=d2b529346fb10c86f8ed57b045a33b4da47160f1;hpb=b043c3d94a7d6440f7c333f835e5d1c921a679b7;p=oota-llvm.git diff --git a/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/lib/DebugInfo/DWARFDebugInfoEntry.cpp index d2b529346fb..2e7a54aeb85 100644 --- a/lib/DebugInfo/DWARFDebugInfoEntry.cpp +++ b/lib/DebugInfo/DWARFDebugInfoEntry.cpp @@ -210,6 +210,16 @@ uint64_t DWARFDebugInfoEntryMinimal::getAttributeValueAsSectionOffset( return Result.hasValue() ? Result.getValue() : FailValue; } +uint64_t +DWARFDebugInfoEntryMinimal::getRangesBaseAttribute(const DWARFUnit *U, + uint64_t FailValue) const { + uint64_t Result = + getAttributeValueAsSectionOffset(U, DW_AT_ranges_base, -1ULL); + if (Result != -1ULL) + return Result; + return getAttributeValueAsSectionOffset(U, DW_AT_GNU_ranges_base, FailValue); +} + bool DWARFDebugInfoEntryMinimal::getLowAndHighPC(const DWARFUnit *U, uint64_t &LowPC, uint64_t &HighPC) const { @@ -277,13 +287,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.