Replace getOrCreateSectionData with registerSection.

There is now no SectionData to be created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238208 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-05-26 15:07:25 +00:00
parent 9ec47b85c7
commit b14ebd6a1d
7 changed files with 18 additions and 28 deletions

View File

@@ -31,7 +31,7 @@ void MipsRegInfoRecord::EmitMipsOptionRecord() {
MCSectionELF *Sec =
Context.getELFSection(".MIPS.options", ELF::SHT_MIPS_OPTIONS,
ELF::SHF_ALLOC | ELF::SHF_MIPS_NOSTRIP, 1, "");
MCA.getOrCreateSectionData(*Sec);
MCA.registerSection(*Sec);
Sec->setAlignment(8);
Streamer->SwitchSection(Sec);
@@ -49,7 +49,7 @@ void MipsRegInfoRecord::EmitMipsOptionRecord() {
} else {
MCSectionELF *Sec = Context.getELFSection(".reginfo", ELF::SHT_MIPS_REGINFO,
ELF::SHF_ALLOC, 24, "");
MCA.getOrCreateSectionData(*Sec);
MCA.registerSection(*Sec);
Sec->setAlignment(MTS->getABI().IsN32() ? 8 : 4);
Streamer->SwitchSection(Sec);

View File

@@ -460,11 +460,11 @@ void MipsTargetELFStreamer::finish() {
// .bss, .text and .data are always at least 16-byte aligned.
MCSection &TextSection = *OFI.getTextSection();
MCA.getOrCreateSectionData(TextSection);
MCA.registerSection(TextSection);
MCSection &DataSection = *OFI.getDataSection();
MCA.getOrCreateSectionData(DataSection);
MCA.registerSection(DataSection);
MCSection &BSSSection = *OFI.getBSSSection();
MCA.getOrCreateSectionData(BSSSection);
MCA.registerSection(BSSSection);
TextSection.setAlignment(std::max(16u, TextSection.getAlignment()));
DataSection.setAlignment(std::max(16u, DataSection.getAlignment()));
@@ -570,7 +570,7 @@ void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) {
const MCSymbolRefExpr *ExprRef =
MCSymbolRefExpr::Create(Name, MCSymbolRefExpr::VK_None, Context);
MCA.getOrCreateSectionData(*Sec);
MCA.registerSection(*Sec);
Sec->setAlignment(4);
OS.PushSection();
@@ -788,7 +788,7 @@ void MipsTargetELFStreamer::emitMipsAbiFlags() {
MCStreamer &OS = getStreamer();
MCSectionELF *Sec = Context.getELFSection(
".MIPS.abiflags", ELF::SHT_MIPS_ABIFLAGS, ELF::SHF_ALLOC, 24, "");
MCA.getOrCreateSectionData(*Sec);
MCA.registerSection(*Sec);
Sec->setAlignment(8);
OS.SwitchSection(Sec);