diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-05-15 21:24:32 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-05-15 21:24:32 +0000 |
commit | b043c3d94a7d6440f7c333f835e5d1c921a679b7 (patch) | |
tree | cacfc8715ba01dcccd1911426943bdff2df40efa /lib/DebugInfo/DWARFDebugLine.cpp | |
parent | 48ea98d1d228dfc58f9662473a4253c052c44b03 (diff) | |
download | llvm-b043c3d94a7d6440f7c333f835e5d1c921a679b7.tar.gz llvm-b043c3d94a7d6440f7c333f835e5d1c921a679b7.tar.bz2 llvm-b043c3d94a7d6440f7c333f835e5d1c921a679b7.tar.xz |
[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
Diffstat (limited to 'lib/DebugInfo/DWARFDebugLine.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFDebugLine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/DebugInfo/DWARFDebugLine.cpp b/lib/DebugInfo/DWARFDebugLine.cpp index a5261d7644..ce87635507 100644 --- a/lib/DebugInfo/DWARFDebugLine.cpp +++ b/lib/DebugInfo/DWARFDebugLine.cpp @@ -15,6 +15,7 @@ #include <algorithm> using namespace llvm; using namespace dwarf; +typedef DILineInfoSpecifier::FileLineInfoKind FileLineInfoKind; DWARFDebugLine::Prologue::Prologue() { clear(); @@ -643,13 +644,14 @@ bool DWARFDebugLine::LineTable::lookupAddressRange( bool DWARFDebugLine::LineTable::getFileNameByIndex(uint64_t FileIndex, - bool NeedsAbsoluteFilePath, + FileLineInfoKind Kind, std::string &Result) const { - if (FileIndex == 0 || FileIndex > Prologue.FileNames.size()) + if (FileIndex == 0 || FileIndex > Prologue.FileNames.size() || + Kind == FileLineInfoKind::None) return false; const FileNameEntry &Entry = Prologue.FileNames[FileIndex - 1]; const char *FileName = Entry.Name; - if (!NeedsAbsoluteFilePath || + if (Kind != FileLineInfoKind::AbsoluteFilePath || sys::path::is_absolute(FileName)) { Result = FileName; return true; |