Compute the ELF SectionKind from the flags.

Any code creating an MCSectionELF knows ELF and already provides the flags.

SectionKind is an abstraction used by common code that uses a plain
MCSection.

Use the flags to compute the SectionKind. This removes a lot of
guessing and boilerplate from the MCSectionELF construction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-01-29 17:33:21 +00:00
parent dec5091220
commit 9936b80df5
21 changed files with 192 additions and 387 deletions

View File

@@ -52,8 +52,8 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info,
// Put this in a custom .note section.
AP.OutStreamer.SwitchSection(
AP.getObjFileLowering().getContext().getELFSection(
".note.gc", ELF::SHT_PROGBITS, 0, SectionKind::getDataRel()));
AP.getObjFileLowering().getContext().getELFSection(".note.gc",
ELF::SHT_PROGBITS, 0));
// For each function...
for (GCModuleInfo::FuncInfoVec::iterator FI = Info.funcinfo_begin(),