Skip to content

Commit 5bae3a0

Browse files
committed
[lldb] Remove CompileUnit::SetSupportFiles overload (NFC)
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.
1 parent 5175cd7 commit 5bae3a0

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lldb/include/lldb/Symbol/CompileUnit.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ class CompileUnit : public std::enable_shared_from_this<CompileUnit>,
331331
/// A line table object pointer that this object now owns.
332332
void SetLineTable(LineTable *line_table);
333333

334-
void SetSupportFiles(const FileSpecList &support_files);
335-
void SetSupportFiles(FileSpecList &&support_files);
334+
void SetSupportFiles(FileSpecList support_files);
336335

337336
void SetDebugMacros(const DebugMacrosSP &debug_macros);
338337

lldb/source/Symbol/CompileUnit.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,7 @@ void CompileUnit::SetLineTable(LineTable *line_table) {
178178
m_line_table_up.reset(line_table);
179179
}
180180

181-
void CompileUnit::SetSupportFiles(const FileSpecList &support_files) {
182-
m_support_files = support_files;
183-
}
184-
185-
void CompileUnit::SetSupportFiles(FileSpecList &&support_files) {
181+
void CompileUnit::SetSupportFiles(FileSpecList support_files) {
186182
m_support_files = std::move(support_files);
187183
}
188184

0 commit comments

Comments
 (0)