File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -866,22 +866,23 @@ void MCAssembler::layout(MCAsmLayout &Layout) {
866
866
Sec->setLayoutOrder (i);
867
867
868
868
// Chain together fragments from all subsections.
869
- MCDummyFragment Dummy;
870
- Dummy. setParent (Sec) ;
871
- MCFragment *Tail = &Dummy;
872
- for (auto &[_, List] : Sec->Subsections ) {
873
- if (!List.Head )
874
- continue ;
875
- Tail->Next = List.Head ;
876
- Tail = List.Tail ;
877
- }
878
- Sec->Subsections .clear ();
879
- Sec->Subsections .push_back ({0u , {Dummy.getNext (), Tail}});
880
- Sec->CurFragList = &Sec->Subsections [0 ].second ;
869
+ if (Sec-> Subsections . size () > 1 ) {
870
+ MCDummyFragment Dummy;
871
+ MCFragment *Tail = &Dummy;
872
+ for (auto &[_, List] : Sec->Subsections ) {
873
+ if (!List.Head )
874
+ continue ;
875
+ Tail->Next = List.Head ;
876
+ Tail = List.Tail ;
877
+ }
878
+ Sec->Subsections .clear ();
879
+ Sec->Subsections .push_back ({0u , {Dummy.getNext (), Tail}});
880
+ Sec->CurFragList = &Sec->Subsections [0 ].second ;
881
881
882
- unsigned FragmentIndex = 0 ;
883
- for (MCFragment &Frag : *Sec)
884
- Frag.setLayoutOrder (FragmentIndex++);
882
+ unsigned FragmentIndex = 0 ;
883
+ for (MCFragment &Frag : *Sec)
884
+ Frag.setLayoutOrder (FragmentIndex++);
885
+ }
885
886
}
886
887
887
888
// Layout until everything fits.
You can’t perform that action at this time.
0 commit comments