Stop using MCSectionData in MCExpr.h.
llvm-svn: 238163
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
index 3199efb..3bf8f72 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
@@ -161,8 +161,8 @@
uint32_t Value = Writer->getSymbolAddress(*A, Layout);
uint32_t Value2 = 0;
- uint64_t SecAddr = Writer->getSectionAddress(
- &A_SD->getFragment()->getParent()->getSectionData());
+ uint64_t SecAddr =
+ Writer->getSectionAddress(A_SD->getFragment()->getParent());
FixedValue += SecAddr;
if (const MCSymbolRefExpr *B = Target.getSymB()) {
@@ -176,8 +176,7 @@
// Select the appropriate difference relocation type.
Type = MachO::ARM_RELOC_HALF_SECTDIFF;
Value2 = Writer->getSymbolAddress(B->getSymbol(), Layout);
- FixedValue -= Writer->getSectionAddress(
- &B_SD->getFragment()->getParent()->getSectionData());
+ FixedValue -= Writer->getSectionAddress(B_SD->getFragment()->getParent());
}
// Relocations are written out in reverse order, so the PAIR comes first.
@@ -265,8 +264,8 @@
"' can not be undefined in a subtraction expression");
uint32_t Value = Writer->getSymbolAddress(*A, Layout);
- uint64_t SecAddr = Writer->getSectionAddress(
- &A_SD->getFragment()->getParent()->getSectionData());
+ uint64_t SecAddr =
+ Writer->getSectionAddress(A_SD->getFragment()->getParent());
FixedValue += SecAddr;
uint32_t Value2 = 0;
@@ -282,8 +281,7 @@
// Select the appropriate difference relocation type.
Type = MachO::ARM_RELOC_SECTDIFF;
Value2 = Writer->getSymbolAddress(B->getSymbol(), Layout);
- FixedValue -= Writer->getSectionAddress(
- &B_SD->getFragment()->getParent()->getSectionData());
+ FixedValue -= Writer->getSectionAddress(B_SD->getFragment()->getParent());
}
// Relocations are written out in reverse order, so the PAIR comes first.
@@ -339,9 +337,8 @@
// BL/BLX also use external relocations when an internal relocation
// would result in the target being out of range. This gives the linker
// enough information to generate a branch island.
- const MCSectionData &SymSD = Asm.getSectionData(S.getSection());
- Value += Writer->getSectionAddress(&SymSD);
- Value -= Writer->getSectionAddress(&Fragment.getParent()->getSectionData());
+ Value += Writer->getSectionAddress(&S.getSection());
+ Value -= Writer->getSectionAddress(Fragment.getParent());
// If the resultant value would be out of range for an internal relocation,
// use an external instead.
if (Value > Range || Value < -(Range + 1))
@@ -430,13 +427,11 @@
} else {
// The index is the section ordinal (1-based).
const MCSection &Sec = A->getSection();
- const MCSectionData &SymSD = Asm.getSectionData(Sec);
Index = Sec.getOrdinal() + 1;
- FixedValue += Writer->getSectionAddress(&SymSD);
+ FixedValue += Writer->getSectionAddress(&Sec);
}
if (IsPCRel)
- FixedValue -=
- Writer->getSectionAddress(&Fragment->getParent()->getSectionData());
+ FixedValue -= Writer->getSectionAddress(Fragment->getParent());
// The type is determined by the fixup kind.
Type = RelocType;
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
index 6fec196..396487c 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
@@ -213,8 +213,8 @@
"' can not be undefined in a subtraction expression");
uint32_t Value = Writer->getSymbolAddress(*A, Layout);
- uint64_t SecAddr = Writer->getSectionAddress(
- &A_SD->getFragment()->getParent()->getSectionData());
+ uint64_t SecAddr =
+ Writer->getSectionAddress(A_SD->getFragment()->getParent());
FixedValue += SecAddr;
uint32_t Value2 = 0;
@@ -227,8 +227,7 @@
// FIXME: is Type correct? see include/llvm/Support/MachO.h
Value2 = Writer->getSymbolAddress(B->getSymbol(), Layout);
- FixedValue -= Writer->getSectionAddress(
- &B_SD->getFragment()->getParent()->getSectionData());
+ FixedValue -= Writer->getSectionAddress(B_SD->getFragment()->getParent());
}
// FIXME: does FixedValue get used??
@@ -366,13 +365,11 @@
} else {
// The index is the section ordinal (1-based).
const MCSection &Sec = A->getSection();
- const MCSectionData &SymSD = Asm.getSectionData(Sec);
Index = Sec.getOrdinal() + 1;
- FixedValue += Writer->getSectionAddress(&SymSD);
+ FixedValue += Writer->getSectionAddress(&Sec);
}
if (IsPCRel)
- FixedValue -=
- Writer->getSectionAddress(&Fragment->getParent()->getSectionData());
+ FixedValue -= Writer->getSectionAddress(Fragment->getParent());
}
// struct relocation_info (8 bytes)
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
index 05b5886..0986b94 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
@@ -364,8 +364,8 @@
false);
uint32_t Value = Writer->getSymbolAddress(*A, Layout);
- uint64_t SecAddr = Writer->getSectionAddress(
- &A_SD->getFragment()->getParent()->getSectionData());
+ uint64_t SecAddr =
+ Writer->getSectionAddress(A_SD->getFragment()->getParent());
FixedValue += SecAddr;
uint32_t Value2 = 0;
@@ -385,8 +385,7 @@
Type = A_SD->isExternal() ? (unsigned)MachO::GENERIC_RELOC_SECTDIFF :
(unsigned)MachO::GENERIC_RELOC_LOCAL_SECTDIFF;
Value2 = Writer->getSymbolAddress(B->getSymbol(), Layout);
- FixedValue -= Writer->getSectionAddress(
- &B_SD->getFragment()->getParent()->getSectionData());
+ FixedValue -= Writer->getSectionAddress(B_SD->getFragment()->getParent());
}
// Relocations are written out in reverse order, so the PAIR comes first.
@@ -560,13 +559,11 @@
} else {
// The index is the section ordinal (1-based).
const MCSection &Sec = A->getSection();
- const MCSectionData &SymSD = Asm.getSectionData(Sec);
Index = Sec.getOrdinal() + 1;
- FixedValue += Writer->getSectionAddress(&SymSD);
+ FixedValue += Writer->getSectionAddress(&Sec);
}
if (IsPCRel)
- FixedValue -=
- Writer->getSectionAddress(&Fragment->getParent()->getSectionData());
+ FixedValue -= Writer->getSectionAddress(Fragment->getParent());
Type = MachO::GENERIC_RELOC_VANILLA;
}