mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Stop forwarding getOrdinal and setOrdinal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238139 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
98e5e8e3f6
commit
8823110a85
@ -597,9 +597,6 @@ public:
|
|||||||
bool hasInstructions() const { return HasInstructions; }
|
bool hasInstructions() const { return HasInstructions; }
|
||||||
void setHasInstructions(bool Value) { HasInstructions = Value; }
|
void setHasInstructions(bool Value) { HasInstructions = Value; }
|
||||||
|
|
||||||
unsigned getOrdinal() const;
|
|
||||||
void setOrdinal(unsigned Value);
|
|
||||||
|
|
||||||
unsigned getLayoutOrder() const { return LayoutOrder; }
|
unsigned getLayoutOrder() const { return LayoutOrder; }
|
||||||
void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
|
void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
|
||||||
|
|
||||||
|
@ -300,9 +300,6 @@ MCSectionData::MCSectionData(MCSection &Section, MCAssembler *A)
|
|||||||
A->getSectionList().push_back(this);
|
A->getSectionList().push_back(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned MCSectionData::getOrdinal() const { return Section->getOrdinal(); }
|
|
||||||
void MCSectionData::setOrdinal(unsigned Value) { Section->setOrdinal(Value); }
|
|
||||||
|
|
||||||
MCSectionData::iterator
|
MCSectionData::iterator
|
||||||
MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
|
MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
|
||||||
if (Subsection == 0 && SubsectionFragmentMap.empty())
|
if (Subsection == 0 && SubsectionFragmentMap.empty())
|
||||||
@ -892,7 +889,7 @@ void MCAssembler::Finish() {
|
|||||||
if (it->getFragmentList().empty())
|
if (it->getFragmentList().empty())
|
||||||
new MCDataFragment(it);
|
new MCDataFragment(it);
|
||||||
|
|
||||||
it->setOrdinal(SectionIndex++);
|
it->getSection().setOrdinal(SectionIndex++);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign layout order indices to sections and fragments.
|
// Assign layout order indices to sections and fragments.
|
||||||
|
@ -349,8 +349,8 @@ void AArch64MachObjectWriter::RecordRelocation(
|
|||||||
"'. Must have non-local symbol earlier in section.");
|
"'. Must have non-local symbol earlier in section.");
|
||||||
// Adjust the relocation to be section-relative.
|
// Adjust the relocation to be section-relative.
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
const MCSectionData &SymSD = Asm.getSectionData(Symbol->getSection());
|
const MCSection &Sec = Symbol->getSection();
|
||||||
Index = SymSD.getOrdinal() + 1;
|
Index = Sec.getOrdinal() + 1;
|
||||||
Value += Writer->getSymbolAddress(*Symbol, Layout);
|
Value += Writer->getSymbolAddress(*Symbol, Layout);
|
||||||
|
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "llvm/MC/MCFixupKindInfo.h"
|
#include "llvm/MC/MCFixupKindInfo.h"
|
||||||
#include "llvm/MC/MCMachOSymbolFlags.h"
|
#include "llvm/MC/MCMachOSymbolFlags.h"
|
||||||
#include "llvm/MC/MCMachObjectWriter.h"
|
#include "llvm/MC/MCMachObjectWriter.h"
|
||||||
|
#include "llvm/MC/MCSection.h"
|
||||||
#include "llvm/MC/MCValue.h"
|
#include "llvm/MC/MCValue.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/MachO.h"
|
#include "llvm/Support/MachO.h"
|
||||||
@ -423,8 +424,9 @@ void ARMMachObjectWriter::RecordRelocation(MachObjectWriter *Writer,
|
|||||||
FixedValue -= Layout.getSymbolOffset(*A);
|
FixedValue -= Layout.getSymbolOffset(*A);
|
||||||
} else {
|
} else {
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
const MCSectionData &SymSD = Asm.getSectionData(A->getSection());
|
const MCSection &Sec = A->getSection();
|
||||||
Index = SymSD.getOrdinal() + 1;
|
const MCSectionData &SymSD = Asm.getSectionData(Sec);
|
||||||
|
Index = Sec.getOrdinal() + 1;
|
||||||
FixedValue += Writer->getSectionAddress(&SymSD);
|
FixedValue += Writer->getSectionAddress(&SymSD);
|
||||||
}
|
}
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
|
@ -363,8 +363,9 @@ void PPCMachObjectWriter::RecordPPCRelocation(
|
|||||||
FixedValue -= Layout.getSymbolOffset(*A);
|
FixedValue -= Layout.getSymbolOffset(*A);
|
||||||
} else {
|
} else {
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
const MCSectionData &SymSD = Asm.getSectionData(A->getSection());
|
const MCSection &Sec = A->getSection();
|
||||||
Index = SymSD.getOrdinal() + 1;
|
const MCSectionData &SymSD = Asm.getSectionData(Sec);
|
||||||
|
Index = Sec.getOrdinal() + 1;
|
||||||
FixedValue += Writer->getSectionAddress(&SymSD);
|
FixedValue += Writer->getSectionAddress(&SymSD);
|
||||||
}
|
}
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
|
@ -190,7 +190,7 @@ void X86MachObjectWriter::RecordX86_64Relocation(
|
|||||||
(!B_Base ? 0 : Writer->getSymbolAddress(*B_Base, Layout));
|
(!B_Base ? 0 : Writer->getSymbolAddress(*B_Base, Layout));
|
||||||
|
|
||||||
if (!A_Base)
|
if (!A_Base)
|
||||||
Index = A_SD.getFragment()->getParent()->getOrdinal() + 1;
|
Index = A_SD.getFragment()->getParent()->getSection().getOrdinal() + 1;
|
||||||
Type = MachO::X86_64_RELOC_UNSIGNED;
|
Type = MachO::X86_64_RELOC_UNSIGNED;
|
||||||
|
|
||||||
MachO::any_relocation_info MRE;
|
MachO::any_relocation_info MRE;
|
||||||
@ -202,7 +202,7 @@ void X86MachObjectWriter::RecordX86_64Relocation(
|
|||||||
if (B_Base)
|
if (B_Base)
|
||||||
RelSymbol = B_Base;
|
RelSymbol = B_Base;
|
||||||
else
|
else
|
||||||
Index = B_SD.getFragment()->getParent()->getOrdinal() + 1;
|
Index = B_SD.getFragment()->getParent()->getSection().getOrdinal() + 1;
|
||||||
Type = MachO::X86_64_RELOC_SUBTRACTOR;
|
Type = MachO::X86_64_RELOC_SUBTRACTOR;
|
||||||
} else {
|
} else {
|
||||||
const MCSymbol *Symbol = &Target.getSymA()->getSymbol();
|
const MCSymbol *Symbol = &Target.getSymA()->getSymbol();
|
||||||
@ -235,7 +235,7 @@ void X86MachObjectWriter::RecordX86_64Relocation(
|
|||||||
Layout.getSymbolOffset(*RelSymbol);
|
Layout.getSymbolOffset(*RelSymbol);
|
||||||
} else if (Symbol->isInSection() && !Symbol->isVariable()) {
|
} else if (Symbol->isInSection() && !Symbol->isVariable()) {
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
Index = SD.getFragment()->getParent()->getOrdinal() + 1;
|
Index = SD.getFragment()->getParent()->getSection().getOrdinal() + 1;
|
||||||
Value += Writer->getSymbolAddress(*Symbol, Layout);
|
Value += Writer->getSymbolAddress(*Symbol, Layout);
|
||||||
|
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
@ -554,8 +554,9 @@ void X86MachObjectWriter::RecordX86Relocation(MachObjectWriter *Writer,
|
|||||||
FixedValue -= Layout.getSymbolOffset(*A);
|
FixedValue -= Layout.getSymbolOffset(*A);
|
||||||
} else {
|
} else {
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
const MCSectionData &SymSD = Asm.getSectionData(A->getSection());
|
const MCSection &Sec = A->getSection();
|
||||||
Index = SymSD.getOrdinal() + 1;
|
const MCSectionData &SymSD = Asm.getSectionData(Sec);
|
||||||
|
Index = Sec.getOrdinal() + 1;
|
||||||
FixedValue += Writer->getSectionAddress(&SymSD);
|
FixedValue += Writer->getSectionAddress(&SymSD);
|
||||||
}
|
}
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
|
Loading…
Reference in New Issue
Block a user