mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
MC: Add MCAsmLayout::FragmentReplaced() helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
93ca7b60bf
commit
aa0d350fe5
@ -47,6 +47,9 @@ public:
|
||||
/// the delta from the old size.
|
||||
void UpdateForSlide(MCFragment *F, int SlideAmount);
|
||||
|
||||
/// \brief Update the layout because a fragment has been replaced.
|
||||
void FragmentReplaced(MCFragment *Src, MCFragment *Dst);
|
||||
|
||||
/// @name Section Access (in layout order)
|
||||
/// @{
|
||||
|
||||
|
@ -73,6 +73,11 @@ void MCAsmLayout::UpdateForSlide(MCFragment *F, int SlideAmount) {
|
||||
getAssembler().LayoutSection(*this, i);
|
||||
}
|
||||
|
||||
void MCAsmLayout::FragmentReplaced(MCFragment *Src, MCFragment *Dst) {
|
||||
Dst->Offset = Src->Offset;
|
||||
Dst->EffectiveSize = Src->EffectiveSize;
|
||||
}
|
||||
|
||||
uint64_t MCAsmLayout::getFragmentAddress(const MCFragment *F) const {
|
||||
assert(F->getParent() && "Missing section()!");
|
||||
return getSectionAddress(F->getParent()) + getFragmentOffset(F);
|
||||
@ -818,13 +823,10 @@ void MCAssembler::FinishLayout(MCAsmLayout &Layout) {
|
||||
SD.getFragmentList().insert(it2, DF);
|
||||
|
||||
// Update the data fragments layout data.
|
||||
//
|
||||
// FIXME: Add MCAsmLayout utility for this.
|
||||
DF->setParent(IF->getParent());
|
||||
DF->setAtom(IF->getAtom());
|
||||
DF->setOrdinal(IF->getOrdinal());
|
||||
Layout.setFragmentOffset(DF, Layout.getFragmentOffset(IF));
|
||||
Layout.setFragmentEffectiveSize(DF, Layout.getFragmentEffectiveSize(IF));
|
||||
Layout.FragmentReplaced(IF, DF);
|
||||
|
||||
// Copy in the data and the fixups.
|
||||
DF->getContents().append(IF->getCode().begin(), IF->getCode().end());
|
||||
|
Loading…
Reference in New Issue
Block a user