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 | dce67348a8fd518d9f605f7a137059065f13ed77 (patch) | |
tree | cc2522db0bfca588c908429e186fef57250550d3 /llvm/lib/DebugInfo/DWARFDebugLine.cpp | |
parent | 900d46ff39de8a4d28cbcbcd864a650f778c5214 (diff) | |
download | llvm-dce67348a8fd518d9f605f7a137059065f13ed77.zip llvm-dce67348a8fd518d9f605f7a137059065f13ed77.tar.gz llvm-dce67348a8fd518d9f605f7a137059065f13ed77.tar.bz2 |
[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.
llvm-svn: 208921
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugLine.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugLine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARFDebugLine.cpp index a5261d7..ce87635 100644 --- a/llvm/lib/DebugInfo/DWARFDebugLine.cpp +++ b/llvm/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; |