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

@@ -420,8 +420,7 @@ void WinCOFFObjectWriter::DefineSymbol(const MCSymbol &Symbol,
} else {
const MCSymbolData &BaseData = Assembler.getSymbolData(*Base);
if (BaseData.getFragment()) {
COFFSection *Sec =
SectionMap[&BaseData.getFragment()->getParent()->getSection()];
COFFSection *Sec = SectionMap[BaseData.getFragment()->getParent()];
if (coff_symbol->Section && coff_symbol->Section != Sec)
report_fatal_error("conflicting sections for symbol");
@@ -689,15 +688,15 @@ void WinCOFFObjectWriter::RecordRelocation(
const MCSymbolData &A_SD = Asm.getSymbolData(A);
MCSectionData const *SectionData = Fragment->getParent();
MCSection *Section = Fragment->getParent();
// Mark this symbol as requiring an entry in the symbol table.
assert(SectionMap.find(&SectionData->getSection()) != SectionMap.end() &&
assert(SectionMap.find(Section) != SectionMap.end() &&
"Section must already have been defined in ExecutePostLayoutBinding!");
assert(SymbolMap.find(&A) != SymbolMap.end() &&
"Symbol must already have been defined in ExecutePostLayoutBinding!");
COFFSection *coff_section = SectionMap[&SectionData->getSection()];
COFFSection *coff_section = SectionMap[Section];
COFFSymbol *coff_symbol = SymbolMap[&A];
const MCSymbolRefExpr *SymB = Target.getSymB();
bool CrossSection = false;