mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 22:58:50 +00:00
MC: Add MCAsmLayout::FragmentReplaced() helper function.
llvm-svn: 103709
This commit is contained in:
parent
d37bcf5e2c
commit
5ef1bcbb97
@ -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