Lines Matching refs:Layout
39 STATISTIC(RelaxationSteps, "Number of assembler layout and relaxation steps");
54 // Compute the section layout order. Virtual sections must go last.
91 // Advance the layout position until the fragment is up-to-date.
240 bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout,
245 if (!Fixup.getValue()->EvaluateAsRelocatable(Target, Layout))
280 Value += Layout.getSymbolOffset(&getSymbolData(Sym));
287 Value -= Layout.getSymbolOffset(&getSymbolData(Sym));
297 uint32_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset();
315 uint64_t MCAssembler::ComputeFragmentSize(const MCAsmLayout &Layout,
330 unsigned Offset = Layout.getFragmentOffset(&AF);
340 if (!OF.getOffset().EvaluateAsAbsolute(TargetLocation, Layout))
344 uint64_t FragmentOffset = Layout.getFragmentOffset(&OF);
367 // We should never try to compute the fragment layout if it's predecessor
384 static void WriteFragmentData(const MCAssembler &Asm, const MCAsmLayout &Layout,
393 uint64_t FragmentSize = Asm.ComputeFragmentSize(Layout, F);
497 const MCAsmLayout &Layout) const {
500 assert(Layout.getSectionFileSize(SD) == 0 && "Invalid size for section!");
542 WriteFragmentData(*this, Layout, *it);
545 Layout.getSectionAddressSize(SD));
549 uint64_t MCAssembler::HandleFixup(const MCAsmLayout &Layout,
555 if (!EvaluateFixup(Layout, Fixup, &F, Target, FixedValue)) {
559 getWriter().RecordRelocation(*this, Layout, &F, Fixup, Target, FixedValue);
566 llvm::errs() << "assembler backend - pre-layout\n--\n";
569 // Create the layout object.
570 MCAsmLayout Layout(*this);
576 // layout.
583 // Assign layout order indices to sections and fragments.
584 for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {
585 MCSectionData *SD = Layout.getSectionOrder()[i];
594 // Layout until everything fits.
595 while (LayoutOnce(Layout))
602 // Finalize the layout, including fragment lowering.
603 FinishLayout(Layout);
606 llvm::errs() << "assembler backend - final-layout\n--\n";
611 // Allow the object writer a chance to perform post-layout binding (for
613 getWriter().ExecutePostLayoutBinding(*this, Layout);
624 uint64_t FixedValue = HandleFixup(Layout, *DF, Fixup);
634 uint64_t FixedValue = HandleFixup(Layout, *IF, Fixup);
643 getWriter().WriteObject(*this, Layout);
650 const MCAsmLayout &Layout) const {
657 if (!EvaluateFixup(Layout, Fixup, DF, Target, Value))
667 const MCAsmLayout &Layout) const {
676 if (FixupNeedsRelaxation(*it, IF, Layout))
682 bool MCAssembler::RelaxInstruction(MCAsmLayout &Layout,
684 if (!FragmentNeedsRelaxation(&IF, Layout))
718 bool MCAssembler::RelaxLEB(MCAsmLayout &Layout, MCLEBFragment &LF) {
721 bool IsAbs = LF.getValue().EvaluateAsAbsolute(Value, Layout);
735 bool MCAssembler::RelaxDwarfLineAddr(MCAsmLayout &Layout,
739 bool IsAbs = DF.getAddrDelta().EvaluateAsAbsolute(AddrDelta, Layout);
752 bool MCAssembler::RelaxDwarfCallFrameFragment(MCAsmLayout &Layout,
756 bool IsAbs = DF.getAddrDelta().EvaluateAsAbsolute(AddrDelta, Layout);
767 bool MCAssembler::LayoutSectionOnce(MCAsmLayout &Layout,
779 relaxedFrag = RelaxInstruction(Layout, *cast<MCInstFragment>(it2));
782 relaxedFrag = RelaxDwarfLineAddr(Layout,
787 RelaxDwarfCallFrameFragment(Layout,
791 relaxedFrag = RelaxLEB(Layout, *cast<MCLEBFragment>(it2));
794 // Update the layout, and remember that we relaxed.
799 Layout.Invalidate(FirstInvalidFragment);
805 bool MCAssembler::LayoutOnce(MCAsmLayout &Layout) {
811 while(LayoutSectionOnce(Layout, SD))
818 void MCAssembler::FinishLayout(MCAsmLayout &Layout) {
819 // The layout is done. Mark every fragment as valid.
820 for (unsigned int i = 0, n = Layout.getSectionOrder().size(); i != n; ++i) {
821 Layout.getFragmentOffset(&*Layout.getSectionOrder()[i]->rbegin());