Return a MCSection from MCFragment::getParent().

Another step in merging MCSectionData and MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238162 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-05-26 00:36:57 +00:00
parent be38d7cb8c
commit f363960679
11 changed files with 86 additions and 67 deletions

View File

@ -67,8 +67,8 @@ bool MachObjectWriter::isFixupKindPCRel(const MCAssembler &Asm, unsigned Kind) {
uint64_t MachObjectWriter::getFragmentAddress(const MCFragment *Fragment,
const MCAsmLayout &Layout) const {
return getSectionAddress(Fragment->getParent()) +
Layout.getFragmentOffset(Fragment);
return getSectionAddress(&Fragment->getParent()->getSectionData()) +
Layout.getFragmentOffset(Fragment);
}
uint64_t MachObjectWriter::getSymbolAddress(const MCSymbol &S,
@ -101,7 +101,8 @@ uint64_t MachObjectWriter::getSymbolAddress(const MCSymbol &S,
return Address;
}
return getSectionAddress(S.getData().getFragment()->getParent()) +
return getSectionAddress(
&S.getData().getFragment()->getParent()->getSectionData()) +
Layout.getSymbolOffset(S);
}
@ -679,7 +680,7 @@ bool MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(
// addr(atom(A)) - addr(atom(B)) == 0.
const MCSymbol &SA = findAliasedSymbol(SymA);
const MCSection &SecA = SA.getSection();
const MCSection &SecB = FB.getParent()->getSection();
const MCSection &SecB = *FB.getParent();
if (IsPCRel) {
// The simple (Darwin, except on x86_64) way of dealing with this was to