Home | History | Annotate | Download | only in MC

Lines Matching refs:Layout

52 STATISTIC(RelaxationSteps, "Number of assembler layout and relaxation steps");
67 // Compute the section layout order. Virtual sections must go last.
105 // Advance the layout position until the fragment is valid.
107 assert(Cur && "Layout bookkeeping error");
331 bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
336 if (!Fixup.getValue()->EvaluateAsRelocatable(Target, Layout))
370 Value += Layout.getSymbolOffset(&getSymbolData(Sym));
375 Value -= Layout.getSymbolOffset(&getSymbolData(Sym));
385 uint32_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset();
395 Backend.processFixupValue(*this, Layout, Fixup, DF, Target, Value,
401 uint64_t MCAssembler::computeFragmentSize(const MCAsmLayout &Layout,
416 unsigned Offset = Layout.getFragmentOffset(&AF);
432 if (!OF.getOffset().EvaluateAsAbsolute(TargetLocation, Layout))
436 uint64_t FragmentOffset = Layout.getFragmentOffset(&OF);
458 // We should never try to compute the fragment layout if its predecessor
512 static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
517 uint64_t FragmentSize = Asm.computeFragmentSize(Layout, F);
662 const MCAsmLayout &Layout) const {
665 assert(Layout.getSectionFileSize(SD) == 0 && "Invalid size for section!");
706 writeFragment(*this, Layout, *it);
709 Layout.getSectionAddressSize(SD));
713 uint64_t MCAssembler::handleFixup(const MCAsmLayout &Layout,
719 if (!evaluateFixup(Layout, Fixup, &F, Target, FixedValue)) {
723 getWriter().RecordRelocation(*this, Layout, &F, Fixup, Target, FixedValue);
730 llvm::errs() << "assembler backend - pre-layout\n--\n";
733 // Create the layout object.
734 MCAsmLayout Layout(*this);
740 // layout.
747 // Assign layout order indices to sections and fragments.
748 for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {
749 MCSectionData *SD = Layout.getSectionOrder()[i];
758 // Layout until everything fits.
759 while (layoutOnce(Layout))
766 // Finalize the layout, including fragment lowering.
767 finishLayout(Layout);
770 llvm::errs() << "assembler backend - final-layout\n--\n";
775 // Allow the object writer a chance to perform post-layout binding (for
777 getWriter().ExecutePostLayoutBinding(*this, Layout);
789 uint64_t FixedValue = handleFixup(Layout, *F, Fixup);
798 getWriter().WriteObject(*this, Layout);
805 const MCAsmLayout &Layout) const {
809 if (!evaluateFixup(Layout, Fixup, DF, Target, Value))
812 return getBackend().fixupNeedsRelaxation(Fixup, Value, DF, Layout);
816 const MCAsmLayout &Layout) const {
825 if (fixupNeedsRelaxation(*it, F, Layout))
831 bool MCAssembler::relaxInstruction(MCAsmLayout &Layout,
833 if (!fragmentNeedsRelaxation(&F, Layout))
864 bool MCAssembler::relaxLEB(MCAsmLayout &Layout, MCLEBFragment &LF) {
867 bool IsAbs = LF.getValue().EvaluateAsAbsolute(Value, Layout);
881 bool MCAssembler::relaxDwarfLineAddr(MCAsmLayout &Layout,
885 bool IsAbs = DF.getAddrDelta().EvaluateAsAbsolute(AddrDelta, Layout);
898 bool MCAssembler::relaxDwarfCallFrameFragment(MCAsmLayout &Layout,
902 bool IsAbs = DF.getAddrDelta().EvaluateAsAbsolute(AddrDelta, Layout);
913 bool MCAssembler::layoutSectionOnce(MCAsmLayout &Layout, MCSectionData &SD) {
914 // Holds the first fragment which needed relaxing during this layout. It will
930 RelaxedFrag = relaxInstruction(Layout, *cast<MCRelaxableFragment>(I));
933 RelaxedFrag = relaxDwarfLineAddr(Layout,
938 relaxDwarfCallFrameFragment(Layout,
942 RelaxedFrag = relaxLEB(Layout, *cast<MCLEBFragment>(I));
949 Layout.invalidateFragmentsFrom(FirstRelaxedFragment);
955 bool MCAssembler::layoutOnce(MCAsmLayout &Layout) {
961 while (layoutSectionOnce(Layout, SD))
968 void MCAssembler::finishLayout(MCAsmLayout &Layout) {
969 // The layout is done. Mark every fragment as valid.
970 for (unsigned int i = 0, n = Layout.getSectionOrder().size(); i != n; ++i) {
971 Layout.getFragmentOffset(&*Layout.getSectionOrder()[i]->rbegin());