Hi Rafael,<div><br></div><div>How do you know the layout is finished here?</div><div><br></div><div>- David Meyer</div><div><br></div><div><br><div class="gmail_quote">On Sat, Dec 4, 2010 at 2:47 PM, Rafael Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Author: rafael<br>
Date: Sat Dec 4 16:47:22 2010<br>
New Revision: 120921<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=120921&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=120921&view=rev</a><br>
Log:<br>
Once the layout is done we don't need to keep updating which fragments are<br>
valid. Addresses will not change.<br>
<br>
Modified:<br>
llvm/trunk/lib/MC/MCAssembler.cpp<br>
<br>
Modified: llvm/trunk/lib/MC/MCAssembler.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=120921&r1=120920&r2=120921&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=120921&r1=120920&r2=120921&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCAssembler.cpp Sat Dec 4 16:47:22 2010<br>
@@ -122,10 +122,6 @@<br>
// Set the data fragment's layout data.<br>
Dst->setParent(Src->getParent());<br>
Dst->setAtom(Src->getAtom());<br>
- Dst->setLayoutOrder(Src->getLayoutOrder());<br>
-<br>
- if (LastValidFragment == Src)<br>
- LastValidFragment = Dst;<br>
<br>
Dst->Offset = Src->Offset;<br>
Dst->EffectiveSize = Src->EffectiveSize;<br>
@@ -136,15 +132,7 @@<br>
<br>
void MCAsmLayout::CoalesceFragments(MCFragment *Src, MCFragment *Dst) {<br>
assert(Src->getPrevNode() == Dst);<br>
-<br>
- if (isFragmentUpToDate(Src)) {<br>
- if (LastValidFragment == Src)<br>
- LastValidFragment = Dst;<br>
- Dst->EffectiveSize += Src->EffectiveSize;<br>
- } else {<br>
- // We don't know the effective size of Src, so we have to invalidate Dst.<br>
- Invalidate(Dst);<br>
- }<br>
+ Dst->EffectiveSize += Src->EffectiveSize;<br>
// Remove Src, but don't delete it yet.<br>
Src->getParent()->getFragmentList().remove(Src);<br>
}<br>
@@ -907,6 +895,10 @@<br>
// cheap (we will mostly end up eliminating fragments and appending on to data<br>
// fragments), so the extra complexity downstream isn't worth it. Evaluate<br>
// this assumption.<br>
+<br>
+ // The layout is done. Mark every fragment as valid.<br>
+ Layout.getFragmentOffset(&*Layout.getSectionOrder().back()->rbegin());<br>
+<br>
unsigned FragmentIndex = 0;<br>
for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {<br>
MCSectionData &SD = *Layout.getSectionOrder()[i];<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>