summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFDebugLine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/DWARFDebugLine.cpp')
-rw-r--r--lib/DebugInfo/DWARFDebugLine.cpp8
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;