@@ -553,18 +553,11 @@ static void writeFragment(raw_ostream &OS, const MCAssembler &Asm,
553553 case MCFragment::FT_Align: {
554554 ++stats::EmittedAlignFragments;
555555 const MCAlignFragment &AF = cast<MCAlignFragment>(F);
556- assert (AF.getValueSize () && " Invalid virtual align in concrete fragment!" );
556+ assert (AF.getFillLen () && " Invalid virtual align in concrete fragment!" );
557557
558- uint64_t Count = FragmentSize / AF.getValueSize ();
559-
560- // FIXME: This error shouldn't actually occur (the front end should emit
561- // multiple .align directives to enforce the semantics it wants), but is
562- // severe enough that we want to report it. How to handle this?
563- if (Count * AF.getValueSize () != FragmentSize)
564- report_fatal_error (" undefined .align directive, value size '" +
565- Twine (AF.getValueSize ()) +
566- " ' is not a divisor of padding size '" +
567- Twine (FragmentSize) + " '" );
558+ uint64_t Count = FragmentSize / AF.getFillLen ();
559+ assert (FragmentSize % AF.getFillLen () == 0 &&
560+ " computeFragmentSize computed size is incorrect" );
568561
569562 // See if we are aligning with nops, and if so do that first to try to fill
570563 // the Count bytes. Then if that did not fill any bytes or there are any
@@ -579,17 +572,19 @@ static void writeFragment(raw_ostream &OS, const MCAssembler &Asm,
579572
580573 // Otherwise, write out in multiples of the value size.
581574 for (uint64_t i = 0 ; i != Count; ++i) {
582- switch (AF.getValueSize ()) {
575+ switch (AF.getFillLen ()) {
583576 default : llvm_unreachable (" Invalid size!" );
584- case 1 : OS << char (AF.getValue ()); break ;
577+ case 1 :
578+ OS << char (AF.getFill ());
579+ break ;
585580 case 2 :
586- support::endian::write<uint16_t >(OS, AF.getValue (), Endian);
581+ support::endian::write<uint16_t >(OS, AF.getFill (), Endian);
587582 break ;
588583 case 4 :
589- support::endian::write<uint32_t >(OS, AF.getValue (), Endian);
584+ support::endian::write<uint32_t >(OS, AF.getFill (), Endian);
590585 break ;
591586 case 8 :
592- support::endian::write<uint64_t >(OS, AF.getValue (), Endian);
587+ support::endian::write<uint64_t >(OS, AF.getFill (), Endian);
593588 break ;
594589 }
595590 }
@@ -733,8 +728,8 @@ void MCAssembler::writeSectionData(raw_ostream &OS,
733728 case MCFragment::FT_Align:
734729 // Check that we aren't trying to write a non-zero value into a virtual
735730 // section.
736- assert ((cast<MCAlignFragment>(F).getValueSize () == 0 ||
737- cast<MCAlignFragment>(F).getValue () == 0 ) &&
731+ assert ((cast<MCAlignFragment>(F).getFillLen () == 0 ||
732+ cast<MCAlignFragment>(F).getFill () == 0 ) &&
738733 " Invalid align in virtual section!" );
739734 break ;
740735 case MCFragment::FT_Fill:
0 commit comments