[llvm-commits] [llvm] r120921 - /llvm/trunk/lib/MC/MCAssembler.cpp

David Meyer pdox at google.com
Sun Dec 5 15:41:34 PST 2010


Hi Rafael,

How do you know the layout is finished here?

- David Meyer


On Sat, Dec 4, 2010 at 2:47 PM, Rafael Espindola <rafael.espindola at gmail.com
> wrote:

> Author: rafael
> Date: Sat Dec  4 16:47:22 2010
> New Revision: 120921
>
> URL: http://llvm.org/viewvc/llvm-project?rev=120921&view=rev
> Log:
> Once the layout is done we don't need to keep updating which fragments are
> valid. Addresses will not change.
>
> Modified:
>    llvm/trunk/lib/MC/MCAssembler.cpp
>
> Modified: llvm/trunk/lib/MC/MCAssembler.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=120921&r1=120920&r2=120921&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/MC/MCAssembler.cpp (original)
> +++ llvm/trunk/lib/MC/MCAssembler.cpp Sat Dec  4 16:47:22 2010
> @@ -122,10 +122,6 @@
>   // Set the data fragment's layout data.
>   Dst->setParent(Src->getParent());
>   Dst->setAtom(Src->getAtom());
> -  Dst->setLayoutOrder(Src->getLayoutOrder());
> -
> -  if (LastValidFragment == Src)
> -    LastValidFragment = Dst;
>
>   Dst->Offset = Src->Offset;
>   Dst->EffectiveSize = Src->EffectiveSize;
> @@ -136,15 +132,7 @@
>
>  void MCAsmLayout::CoalesceFragments(MCFragment *Src, MCFragment *Dst) {
>   assert(Src->getPrevNode() == Dst);
> -
> -  if (isFragmentUpToDate(Src)) {
> -    if (LastValidFragment == Src)
> -      LastValidFragment = Dst;
> -    Dst->EffectiveSize += Src->EffectiveSize;
> -  } else {
> -    // We don't know the effective size of Src, so we have to invalidate
> Dst.
> -    Invalidate(Dst);
> -  }
> +  Dst->EffectiveSize += Src->EffectiveSize;
>   // Remove Src, but don't delete it yet.
>   Src->getParent()->getFragmentList().remove(Src);
>  }
> @@ -907,6 +895,10 @@
>   // cheap (we will mostly end up eliminating fragments and appending on to
> data
>   // fragments), so the extra complexity downstream isn't worth it.
> Evaluate
>   // this assumption.
> +
> +  // The layout is done. Mark every fragment as valid.
> +  Layout.getFragmentOffset(&*Layout.getSectionOrder().back()->rbegin());
> +
>   unsigned FragmentIndex = 0;
>   for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {
>     MCSectionData &SD = *Layout.getSectionOrder()[i];
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101205/6d4cd8b5/attachment.html>


More information about the llvm-commits mailing list