aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-01-24 22:00:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-01-24 22:00:03 +0000
commit480093f4440d54b30b3025afeac24b48f2ba7a2e (patch)
tree162e72994062888647caf0d875428db9445491a8 /contrib/llvm-project/lldb/source/Core/SourceManager.cpp
parent489b1cf2ecf5b9b4a394857987014bfb09067726 (diff)
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'contrib/llvm-project/lldb/source/Core/SourceManager.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Core/SourceManager.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/contrib/llvm-project/lldb/source/Core/SourceManager.cpp b/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
index 42741e4ba4fe..8e0cc57f80c1 100644
--- a/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
+++ b/contrib/llvm-project/lldb/source/Core/SourceManager.cpp
@@ -64,7 +64,8 @@ SourceManager::~SourceManager() {}
SourceManager::FileSP SourceManager::GetFile(const FileSpec &file_spec) {
bool same_as_previous =
- m_last_file_sp && m_last_file_sp->FileSpecMatches(file_spec);
+ m_last_file_sp &&
+ FileSpec::Match(file_spec, m_last_file_sp->GetFileSpec());
DebuggerSP debugger_sp(m_debugger_wp.lock());
FileSP file_sp;
@@ -399,24 +400,25 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec,
if (num_matches != 0) {
if (num_matches > 1) {
SymbolContext sc;
- FileSpec *test_cu_spec = nullptr;
+ CompileUnit *test_cu = nullptr;
for (unsigned i = 0; i < num_matches; i++) {
sc_list.GetContextAtIndex(i, sc);
if (sc.comp_unit) {
- if (test_cu_spec) {
- if (test_cu_spec != static_cast<FileSpec *>(sc.comp_unit))
+ if (test_cu) {
+ if (test_cu != sc.comp_unit)
got_multiple = true;
break;
} else
- test_cu_spec = sc.comp_unit;
+ test_cu = sc.comp_unit;
}
}
}
if (!got_multiple) {
SymbolContext sc;
sc_list.GetContextAtIndex(0, sc);
- m_file_spec = sc.comp_unit;
+ if (sc.comp_unit)
+ m_file_spec = sc.comp_unit->GetPrimaryFile();
m_mod_time = FileSystem::Instance().GetModificationTime(m_file_spec);
}
}
@@ -601,10 +603,6 @@ void SourceManager::File::FindLinesMatchingRegex(
}
}
-bool SourceManager::File::FileSpecMatches(const FileSpec &file_spec) {
- return FileSpec::Equal(m_file_spec, file_spec, false);
-}
-
bool lldb_private::operator==(const SourceManager::File &lhs,
const SourceManager::File &rhs) {
if (lhs.m_file_spec != rhs.m_file_spec)