Skip to content

Commit 98bde7f

Browse files
committed
[lldb] Avoid FileSpec indirection where we can use SupportFiles directly
Now that more parts of LLDB know about SupportFiles, avoid going through FileSpec (and losing the Checksum in the process). Instead, use the SupportFile directly.
1 parent d966d47 commit 98bde7f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lldb/source/Commands/CommandObjectSource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ class CommandObjectSourceList : public CommandObjectParsed {
10531053
? sc.line_entry.column
10541054
: 0;
10551055
target.GetSourceManager().DisplaySourceLinesWithLineNumbers(
1056-
std::make_shared<SupportFile>(sc.comp_unit->GetPrimaryFile()),
1056+
sc.comp_unit->GetPrimarySupportFile(),
10571057
sc.line_entry.line, column, lines_to_back_up,
10581058
m_options.num_lines - lines_to_back_up, "->",
10591059
&result.GetOutputStream(), GetBreakpointLocations());
@@ -1174,7 +1174,7 @@ class CommandObjectSourceList : public CommandObjectParsed {
11741174
m_options.num_lines = 10;
11751175
const uint32_t column = 0;
11761176
target.GetSourceManager().DisplaySourceLinesWithLineNumbers(
1177-
std::make_shared<SupportFile>(sc.comp_unit->GetPrimaryFile()),
1177+
sc.comp_unit->GetPrimarySupportFile(),
11781178
m_options.start_line, column, 0, m_options.num_lines, "",
11791179
&result.GetOutputStream(), GetBreakpointLocations());
11801180

lldb/source/Core/SourceManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,7 @@ void SourceManager::File::CommonInitializer(SupportFileSP support_file_sp,
504504
SymbolContext sc;
505505
sc_list.GetContextAtIndex(0, sc);
506506
if (sc.comp_unit)
507-
SetSupportFile(std::make_shared<SupportFile>(
508-
sc.comp_unit->GetPrimaryFile()));
507+
SetSupportFile(sc.comp_unit->GetPrimarySupportFile());
509508
}
510509
}
511510
}

lldb/source/Symbol/LineTable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ bool LineTable::ConvertEntryAtIndexToLineEntry(uint32_t idx,
288288
else
289289
line_entry.range.SetByteSize(0);
290290

291-
line_entry.file_sp = std::make_shared<SupportFile>(
292-
m_comp_unit->GetSupportFiles().GetFileSpecAtIndex(entry.file_idx));
291+
line_entry.file_sp =
292+
m_comp_unit->GetSupportFiles().GetSupportFileAtIndex(entry.file_idx);
293293
line_entry.original_file_sp =
294294
m_comp_unit->GetSupportFiles().GetSupportFileAtIndex(entry.file_idx);
295295
line_entry.line = entry.line;

0 commit comments

Comments
 (0)