Lines Matching refs:Layout
169 bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout, in evaluateFixup() argument
178 if (!Expr->evaluateAsRelocatable(Target, &Layout, &Fixup)) { in evaluateFixup()
214 Value += Layout.getSymbolOffset(Sym); in evaluateFixup()
219 Value -= Layout.getSymbolOffset(Sym); in evaluateFixup()
229 uint32_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset(); in evaluateFixup()
239 Backend.processFixupValue(*this, Layout, Fixup, DF, Target, Value, in evaluateFixup()
245 uint64_t MCAssembler::computeFragmentSize(const MCAsmLayout &Layout, in computeFragmentSize() argument
265 unsigned Offset = Layout.getFragmentOffset(&AF); in computeFragmentSize()
281 if (!OF.getOffset().evaluateAsValue(Value, Layout)) in computeFragmentSize()
285 uint64_t FragmentOffset = Layout.getFragmentOffset(&OF); in computeFragmentSize()
289 if (!Layout.getSymbolOffset(A->getSymbol(), Val)) in computeFragmentSize()
421 static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout, in writeFragment() argument
426 uint64_t FragmentSize = Asm.computeFragmentSize(Layout, F); in writeFragment()
564 const MCAsmLayout &Layout) const { in writeSectionData()
567 assert(Layout.getSectionFileSize(Sec) == 0 && "Invalid size for section!"); in writeSectionData()
611 writeFragment(*this, Layout, F); in writeSectionData()
614 Layout.getSectionAddressSize(Sec)); in writeSectionData()
617 std::pair<uint64_t, bool> MCAssembler::handleFixup(const MCAsmLayout &Layout, in handleFixup() argument
625 if (!evaluateFixup(Layout, Fixup, &F, Target, FixedValue)) { in handleFixup()
629 getWriter().recordRelocation(*this, Layout, &F, Fixup, Target, IsPCRel, in handleFixup()
635 void MCAssembler::layout(MCAsmLayout &Layout) { in layout() argument
652 for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) { in layout()
653 MCSection *Sec = Layout.getSectionOrder()[i]; in layout()
662 while (layoutOnce(Layout)) in layout()
670 finishLayout(Layout); in layout()
678 getWriter().executePostLayoutBinding(*this, Layout); in layout()
708 std::tie(FixedValue, IsPCRel) = handleFixup(Layout, Frag, Fixup); in layout()
718 MCAsmLayout Layout(*this); in Finish() local
719 layout(Layout); in Finish()
725 getWriter().writeObject(*this, Layout); in Finish()
732 const MCAsmLayout &Layout) const { in fixupNeedsRelaxation()
735 bool Resolved = evaluateFixup(Layout, Fixup, DF, Target, Value); in fixupNeedsRelaxation()
737 Layout); in fixupNeedsRelaxation()
741 const MCAsmLayout &Layout) const { in fragmentNeedsRelaxation()
749 if (fixupNeedsRelaxation(Fixup, F, Layout)) in fragmentNeedsRelaxation()
755 bool MCAssembler::relaxInstruction(MCAsmLayout &Layout, in relaxInstruction() argument
757 if (!fragmentNeedsRelaxation(&F, Layout)) in relaxInstruction()
787 bool MCAssembler::relaxLEB(MCAsmLayout &Layout, MCLEBFragment &LF) { in relaxLEB() argument
790 bool Abs = LF.getValue().evaluateKnownAbsolute(Value, Layout); in relaxLEB()
803 bool MCAssembler::relaxDwarfLineAddr(MCAsmLayout &Layout, in relaxDwarfLineAddr() argument
805 MCContext &Context = Layout.getAssembler().getContext(); in relaxDwarfLineAddr()
808 bool Abs = DF.getAddrDelta().evaluateKnownAbsolute(AddrDelta, Layout); in relaxDwarfLineAddr()
821 bool MCAssembler::relaxDwarfCallFrameFragment(MCAsmLayout &Layout, in relaxDwarfCallFrameFragment() argument
823 MCContext &Context = Layout.getAssembler().getContext(); in relaxDwarfCallFrameFragment()
826 bool Abs = DF.getAddrDelta().evaluateKnownAbsolute(AddrDelta, Layout); in relaxDwarfCallFrameFragment()
836 bool MCAssembler::relaxCVInlineLineTable(MCAsmLayout &Layout, in relaxCVInlineLineTable() argument
839 getContext().getCVContext().encodeInlineLineTable(Layout, F); in relaxCVInlineLineTable()
843 bool MCAssembler::relaxCVDefRange(MCAsmLayout &Layout, in relaxCVDefRange() argument
846 getContext().getCVContext().encodeDefRange(Layout, F); in relaxCVDefRange()
850 bool MCAssembler::layoutSectionOnce(MCAsmLayout &Layout, MCSection &Sec) { in layoutSectionOnce() argument
867 RelaxedFrag = relaxInstruction(Layout, *cast<MCRelaxableFragment>(I)); in layoutSectionOnce()
870 RelaxedFrag = relaxDwarfLineAddr(Layout, in layoutSectionOnce()
875 relaxDwarfCallFrameFragment(Layout, in layoutSectionOnce()
879 RelaxedFrag = relaxLEB(Layout, *cast<MCLEBFragment>(I)); in layoutSectionOnce()
883 relaxCVInlineLineTable(Layout, *cast<MCCVInlineLineTableFragment>(I)); in layoutSectionOnce()
886 RelaxedFrag = relaxCVDefRange(Layout, *cast<MCCVDefRangeFragment>(I)); in layoutSectionOnce()
893 Layout.invalidateFragmentsFrom(FirstRelaxedFragment); in layoutSectionOnce()
899 bool MCAssembler::layoutOnce(MCAsmLayout &Layout) { in layoutOnce() argument
905 while (layoutSectionOnce(Layout, Sec)) in layoutOnce()
912 void MCAssembler::finishLayout(MCAsmLayout &Layout) { in finishLayout() argument
914 for (unsigned int i = 0, n = Layout.getSectionOrder().size(); i != n; ++i) { in finishLayout()
915 Layout.getFragmentOffset(&*Layout.getSectionOrder()[i]->rbegin()); in finishLayout()
917 getBackend().finishLayout(*this, Layout); in finishLayout()