From 706b4fc47bbc608932d3b491ae19a3b9cde9497b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 17 Jan 2020 20:45:01 +0000 Subject: Vendor import of llvm-project master e26a78e70, the last commit before the llvmorg-11-init tag, from which release/10.x was branched. --- lldb/source/Core/SourceManager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lldb/source/Core/SourceManager.cpp') diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp index 42741e4ba4fe..8e0cc57f80c1 100644 --- a/lldb/source/Core/SourceManager.cpp +++ b/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(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) -- cgit v1.2.3