mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -46,19 +46,22 @@ STATISTIC(ObjectBytes, "Number of emitted object file bytes");
|
||||
/* *** */
|
||||
|
||||
uint64_t MCAsmLayout::getFragmentAddress(const MCFragment *F) const {
|
||||
return F->getAddress();
|
||||
assert(F->getParent() && "Missing section()!");
|
||||
return getSectionAddress(F->getParent()) + F->getOffset();
|
||||
}
|
||||
|
||||
uint64_t MCAsmLayout::getSymbolAddress(const MCSymbolData *SD) const {
|
||||
return SD->getAddress();
|
||||
assert(SD->getFragment() && "Invalid getAddress() on undefined symbol!");
|
||||
return getFragmentAddress(SD->getFragment()) + SD->getOffset();
|
||||
}
|
||||
|
||||
uint64_t MCAsmLayout::getSectionAddress(const MCSectionData *SD) const {
|
||||
return SD->getAddress();
|
||||
assert(SD->Address != ~UINT64_C(0) && "Address not set!");
|
||||
return SD->Address;
|
||||
}
|
||||
|
||||
void MCAsmLayout::setSectionAddress(MCSectionData *SD, uint64_t Value) {
|
||||
SD->setAddress(Value);
|
||||
SD->Address = Value;
|
||||
}
|
||||
|
||||
/* *** */
|
||||
@ -78,11 +81,6 @@ MCFragment::MCFragment(FragmentType _Kind, MCSectionData *_Parent)
|
||||
MCFragment::~MCFragment() {
|
||||
}
|
||||
|
||||
uint64_t MCFragment::getAddress() const {
|
||||
assert(getParent() && "Missing Section!");
|
||||
return getParent()->getAddress() + Offset;
|
||||
}
|
||||
|
||||
/* *** */
|
||||
|
||||
MCSectionData::MCSectionData() : Section(0) {}
|
||||
|
Reference in New Issue
Block a user