[DWARF parser] Use enums instead of bitfields in DILineInfoSpecifier.

It is more appropriate than the current situation, when one flag
(AbsoluteFilePath) is relevant only if another flag is set.

This refactoring would also simplify fetching the short function name
(stored in DW_AT_name) instead of a linkage name returned currently.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208921 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov
2014-05-15 21:24:32 +00:00
parent 48ea98d1d2
commit b043c3d94a
8 changed files with 79 additions and 81 deletions

View File

@@ -18,6 +18,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace dwarf;
typedef DILineInfoSpecifier::FunctionNameKind FunctionNameKind;
void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS, const DWARFUnit *u,
unsigned recurseDepth,
@@ -272,8 +273,9 @@ bool DWARFDebugInfoEntryMinimal::addressRangeContainsAddress(
}
const char *
DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U) const {
if (!isSubroutineDIE())
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 =
@@ -290,7 +292,7 @@ DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U) const {
if (spec_ref != -1U) {
DWARFDebugInfoEntryMinimal spec_die;
if (spec_die.extractFast(U, &spec_ref)) {
if (const char *name = spec_die.getSubroutineName(U))
if (const char *name = spec_die.getSubroutineName(U, Kind))
return name;
}
}
@@ -300,7 +302,7 @@ DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U) const {
if (abs_origin_ref != -1U) {
DWARFDebugInfoEntryMinimal abs_origin_die;
if (abs_origin_die.extractFast(U, &abs_origin_ref)) {
if (const char *name = abs_origin_die.getSubroutineName(U))
if (const char *name = abs_origin_die.getSubroutineName(U, Kind))
return name;
}
}