mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Once the layout is done we don't need to keep updating which fragments are
valid. Addresses will not change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120921 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
db74aeadcd
commit
b4172fa729
@ -122,10 +122,6 @@ void MCAsmLayout::ReplaceFragment(MCFragment *Src, MCFragment *Dst) {
|
|||||||
// Set the data fragment's layout data.
|
// Set the data fragment's layout data.
|
||||||
Dst->setParent(Src->getParent());
|
Dst->setParent(Src->getParent());
|
||||||
Dst->setAtom(Src->getAtom());
|
Dst->setAtom(Src->getAtom());
|
||||||
Dst->setLayoutOrder(Src->getLayoutOrder());
|
|
||||||
|
|
||||||
if (LastValidFragment == Src)
|
|
||||||
LastValidFragment = Dst;
|
|
||||||
|
|
||||||
Dst->Offset = Src->Offset;
|
Dst->Offset = Src->Offset;
|
||||||
Dst->EffectiveSize = Src->EffectiveSize;
|
Dst->EffectiveSize = Src->EffectiveSize;
|
||||||
@ -136,15 +132,7 @@ void MCAsmLayout::ReplaceFragment(MCFragment *Src, MCFragment *Dst) {
|
|||||||
|
|
||||||
void MCAsmLayout::CoalesceFragments(MCFragment *Src, MCFragment *Dst) {
|
void MCAsmLayout::CoalesceFragments(MCFragment *Src, MCFragment *Dst) {
|
||||||
assert(Src->getPrevNode() == Dst);
|
assert(Src->getPrevNode() == Dst);
|
||||||
|
Dst->EffectiveSize += Src->EffectiveSize;
|
||||||
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);
|
|
||||||
}
|
|
||||||
// Remove Src, but don't delete it yet.
|
// Remove Src, but don't delete it yet.
|
||||||
Src->getParent()->getFragmentList().remove(Src);
|
Src->getParent()->getFragmentList().remove(Src);
|
||||||
}
|
}
|
||||||
@ -907,6 +895,10 @@ void MCAssembler::FinishLayout(MCAsmLayout &Layout) {
|
|||||||
// cheap (we will mostly end up eliminating fragments and appending on to data
|
// cheap (we will mostly end up eliminating fragments and appending on to data
|
||||||
// fragments), so the extra complexity downstream isn't worth it. Evaluate
|
// fragments), so the extra complexity downstream isn't worth it. Evaluate
|
||||||
// this assumption.
|
// this assumption.
|
||||||
|
|
||||||
|
// The layout is done. Mark every fragment as valid.
|
||||||
|
Layout.getFragmentOffset(&*Layout.getSectionOrder().back()->rbegin());
|
||||||
|
|
||||||
unsigned FragmentIndex = 0;
|
unsigned FragmentIndex = 0;
|
||||||
for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {
|
for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {
|
||||||
MCSectionData &SD = *Layout.getSectionOrder()[i];
|
MCSectionData &SD = *Layout.getSectionOrder()[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user