@@ -473,6 +473,8 @@ bool Section::ContainsOnlyDebugInfo() const {
473473
474474#pragma mark SectionList
475475
476+ SectionList::SectionList (const SectionList &rhs) : m_sections(rhs.m_sections) {}
477+
476478SectionList &SectionList::operator =(const SectionList &rhs) {
477479 if (this != &rhs)
478480 m_sections = rhs.m_sections ;
@@ -683,18 +685,18 @@ uint64_t SectionList::GetDebugInfoSize() const {
683685 return debug_info_size;
684686}
685687
686- std::shared_ptr< SectionList>
687- SectionList::Merge (SectionList &lhs, SectionList &rhs, MergeCallback filter) {
688- std::shared_ptr< SectionList> output_sp = std::make_shared<SectionList>() ;
688+ SectionList SectionList::Merge ( SectionList &lhs, SectionList &rhs,
689+ MergeCallback filter) {
690+ SectionList output_list ;
689691
690692 // Iterate through all the sections in lhs and see if we have matches in
691693 // the rhs list.
692694 for (const auto &lhs_section : lhs) {
693695 auto rhs_section = rhs.FindSectionByName (lhs_section->GetName ());
694696 if (rhs_section)
695- output_sp-> AddSection (filter (lhs_section, rhs_section));
697+ output_list. AddSection (filter (lhs_section, rhs_section));
696698 else
697- output_sp-> AddSection (lhs_section);
699+ output_list. AddSection (lhs_section);
698700 }
699701
700702 // Now that we've visited all possible duplicates, we can iterate over
@@ -704,10 +706,10 @@ SectionList::Merge(SectionList &lhs, SectionList &rhs, MergeCallback filter) {
704706 // Because we already visited everything overlapping between rhs
705707 // and lhs, any section not in lhs is unique and can be output.
706708 if (!lhs_section)
707- output_sp-> AddSection (rhs_section);
709+ output_list. AddSection (rhs_section);
708710 }
709711
710- return output_sp ;
712+ return output_list ;
711713}
712714
713715namespace llvm {
0 commit comments