Lines Matching refs:Layout

191 bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
207 if (!Expr->evaluateAsRelocatable(Target, &Layout, &Fixup)) {
224 return getBackend().evaluateTargetFixup(*this, Layout, Fixup, DF, Target,
257 Value += Layout.getSymbolOffset(Sym);
262 Value -= Layout.getSymbolOffset(Sym);
271 uint32_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset();
288 uint64_t MCAssembler::computeFragmentSize(const MCAsmLayout &Layout,
301 if (!FF.getNumValues().evaluateAsAbsolute(NumValues, Layout)) {
325 unsigned Offset = Layout.getFragmentOffset(&AF);
348 if (!OF.getOffset().evaluateAsValue(Value, Layout)) {
354 uint64_t FragmentOffset = Layout.getFragmentOffset(&OF);
358 if (!Layout.getSymbolOffset(A->getSymbol(), Val)) {
499 const MCAsmLayout &Layout, const MCFragment &F) {
501 uint64_t FragmentSize = Asm.computeFragmentSize(Layout, F);
669 const MCAsmLayout &Layout) const {
674 assert(Layout.getSectionFileSize(Sec) == 0 && "Invalid size for section!");
718 writeFragment(OS, *this, Layout, F);
720 assert(OS.tell() - Start == Layout.getSectionAddressSize(Sec));
724 MCAssembler::handleFixup(const MCAsmLayout &Layout, MCFragment &F,
730 bool IsResolved = evaluateFixup(Layout, Fixup, &F, Target, FixedValue,
746 getWriter().recordRelocation(*this, Layout, &F, FixupAdd, TargetAdd,
750 getWriter().recordRelocation(*this, Layout, &F, FixupSub, TargetSub,
753 getWriter().recordRelocation(*this, Layout, &F, Fixup, Target,
760 void MCAssembler::layout(MCAsmLayout &Layout) {
778 for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {
779 MCSection *Sec = Layout.getSectionOrder()[i];
787 // Layout until everything fits.
788 while (layoutOnce(Layout))
797 finishLayout(Layout);
805 getWriter().executePostLayoutBinding(*this, Layout);
843 getBackend().shouldInsertFixupForCodeAlign(*this, Layout, *AF);
857 handleFixup(Layout, Frag, Fixup);
867 MCAsmLayout Layout(*this);
868 layout(Layout);
871 stats::ObjectBytes += getWriter().writeObject(*this, Layout);
876 const MCAsmLayout &Layout) const {
881 bool Resolved = evaluateFixup(Layout, Fixup, DF, Target, Value, WasForced);
887 Layout, WasForced);
891 const MCAsmLayout &Layout) const {
900 if (fixupNeedsRelaxation(Fixup, F, Layout))
906 bool MCAssembler::relaxInstruction(MCAsmLayout &Layout,
910 if (!fragmentNeedsRelaxation(&F, Layout))
940 bool MCAssembler::relaxLEB(MCAsmLayout &Layout, MCLEBFragment &LF) {
943 bool Abs = LF.getValue().evaluateKnownAbsolute(Value, Layout);
997 bool MCAssembler::relaxBoundaryAlign(MCAsmLayout &Layout,
1003 uint64_t AlignedOffset = Layout.getFragmentOffset(BF.getNextNode());
1011 AlignedSize += computeFragmentSize(Layout, *F);
1022 Layout.invalidateFragmentsFrom(&BF);
1026 bool MCAssembler::relaxDwarfLineAddr(MCAsmLayout &Layout,
1028 MCContext &Context = Layout.getAssembler().getContext();
1031 bool Abs = DF.getAddrDelta().evaluateKnownAbsolute(AddrDelta, Layout);
1067 bool MCAssembler::relaxDwarfCallFrameFragment(MCAsmLayout &Layout,
1069 MCContext &Context = Layout.getAssembler().getContext();
1072 bool Abs = DF.getAddrDelta().evaluateKnownAbsolute(AddrDelta, Layout);
1097 bool MCAssembler::relaxCVInlineLineTable(MCAsmLayout &Layout,
1100 getContext().getCVContext().encodeInlineLineTable(Layout, F);
1104 bool MCAssembler::relaxCVDefRange(MCAsmLayout &Layout,
1107 getContext().getCVContext().encodeDefRange(Layout, F);
1111 bool MCAssembler::layoutSectionOnce(MCAsmLayout &Layout, MCSection &Sec) {
1128 RelaxedFrag = relaxInstruction(Layout, *cast<MCRelaxableFragment>(I));
1131 RelaxedFrag = relaxDwarfLineAddr(Layout,
1136 relaxDwarfCallFrameFragment(Layout,
1140 RelaxedFrag = relaxLEB(Layout, *cast<MCLEBFragment>(I));
1144 relaxBoundaryAlign(Layout, *cast<MCBoundaryAlignFragment>(I));
1148 relaxCVInlineLineTable(Layout, *cast<MCCVInlineLineTableFragment>(I));
1151 RelaxedFrag = relaxCVDefRange(Layout, *cast<MCCVDefRangeFragment>(I));
1158 Layout.invalidateFragmentsFrom(FirstRelaxedFragment);
1164 bool MCAssembler::layoutOnce(MCAsmLayout &Layout) {
1170 while (layoutSectionOnce(Layout, Sec))
1177 void MCAssembler::finishLayout(MCAsmLayout &Layout) {
1180 for (unsigned int i = 0, n = Layout.getSectionOrder().size(); i != n; ++i) {
1181 MCSection &Section = *Layout.getSectionOrder()[i];
1182 Layout.getFragmentOffset(&*Section.getFragmentList().rbegin());
1183 computeFragmentSize(Layout, *Section.getFragmentList().rbegin());
1185 getBackend().finishLayout(*this, Layout);