Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
[lldb] Remove CompileUnit::SetSupportFiles overload (NFC)
Browse files Browse the repository at this point in the history
CompileUnit::SetSupportFiles had two overloads, one that took and lvalue
reference and one that takes an rvalue reference. This removes both and
replaces it with an overload that takes the FileSpecList by value and
moves it into the member variable.

Because we're storing the value as a member, this covers both cases. If
the new FileSpecList was passed by lvalue reference, we'd copy it into
the member anyway. If it was passed as an rvalue reference, we'll have
created a new instance using its move and then immediately move it again
into our member. In either case the number of copies remains unchanged.
  • Loading branch information
JDevlieghere committed Oct 19, 2023
1 parent 5175cd7 commit 5bae3a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lldb/include/lldb/Symbol/CompileUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ class CompileUnit : public std::enable_shared_from_this<CompileUnit>,
/// A line table object pointer that this object now owns.
void SetLineTable(LineTable *line_table);

void SetSupportFiles(const FileSpecList &support_files);
void SetSupportFiles(FileSpecList &&support_files);
void SetSupportFiles(FileSpecList support_files);

void SetDebugMacros(const DebugMacrosSP &debug_macros);

Expand Down
6 changes: 1 addition & 5 deletions lldb/source/Symbol/CompileUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ void CompileUnit::SetLineTable(LineTable *line_table) {
m_line_table_up.reset(line_table);
}

void CompileUnit::SetSupportFiles(const FileSpecList &support_files) {
m_support_files = support_files;
}

void CompileUnit::SetSupportFiles(FileSpecList &&support_files) {
void CompileUnit::SetSupportFiles(FileSpecList support_files) {
m_support_files = std::move(support_files);
}

Expand Down

0 comments on commit 5bae3a0

Please sign in to comment.