mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99249 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -715,7 +715,7 @@ void MCAssembler::FinishLayout(MCAsmLayout &Layout) {
|
||||
|
||||
// Create a new data fragment for the instruction.
|
||||
//
|
||||
// FIXME: Reuse previous data fragment if possible.
|
||||
// FIXME-PERF: Reuse previous data fragment if possible.
|
||||
MCDataFragment *DF = new MCDataFragment();
|
||||
SD.getFragmentList().insert(it2, DF);
|
||||
|
||||
|
@@ -383,12 +383,19 @@ void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {
|
||||
Assembler.getEmitter().EncodeInstruction(Inst, VecOS, Fixups);
|
||||
VecOS.flush();
|
||||
|
||||
// Add the fixups and data.
|
||||
MCDataFragment *DF = getOrCreateDataFragment();
|
||||
// FIXME: Eliminate this copy.
|
||||
SmallVector<MCAsmFixup, 4> AsmFixups;
|
||||
for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {
|
||||
MCFixup &F = Fixups[i];
|
||||
DF->addFixup(MCAsmFixup(DF->getContents().size()+F.getOffset(),
|
||||
*F.getValue(), F.getKind()));
|
||||
AsmFixups.push_back(MCAsmFixup(F.getOffset(), *F.getValue(),
|
||||
F.getKind()));
|
||||
}
|
||||
|
||||
// Add the fixups and data.
|
||||
MCDataFragment *DF = getOrCreateDataFragment();
|
||||
for (unsigned i = 0, e = AsmFixups.size(); i != e; ++i) {
|
||||
AsmFixups[i].Offset += DF->getContents().size();
|
||||
DF->addFixup(AsmFixups[i]);
|
||||
}
|
||||
DF->getContents().append(Code.begin(), Code.end());
|
||||
}
|
||||
|
Reference in New Issue
Block a user