From 0709a7bd1a75191a13580ca2a505fa0f7c4326bd Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 21 May 2015 19:20:38 +0000 Subject: Move alignment from MCSectionData to MCSection. This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936 --- llvm/lib/MC/MCWinEH.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'llvm/lib/MC/MCWinEH.cpp') diff --git a/llvm/lib/MC/MCWinEH.cpp b/llvm/lib/MC/MCWinEH.cpp index b1c95f800cf..d5d9eadf39a 100644 --- a/llvm/lib/MC/MCWinEH.cpp +++ b/llvm/lib/MC/MCWinEH.cpp @@ -25,9 +25,10 @@ namespace WinEH { /// associated with that comdat. If the code described is not in the main .text /// section, make a new section for it. Otherwise use the main unwind info /// section. -static const MCSection *getUnwindInfoSection( - StringRef SecName, const MCSectionCOFF *UnwindSec, const MCSymbol *Function, - MCContext &Context) { +static MCSection *getUnwindInfoSection(StringRef SecName, + MCSectionCOFF *UnwindSec, + const MCSymbol *Function, + MCContext &Context) { if (Function && Function->isInSection()) { // If Function is in a COMDAT, get or create an unwind info section in that // COMDAT group. @@ -59,16 +60,16 @@ static const MCSection *getUnwindInfoSection( } -const MCSection *UnwindEmitter::getPDataSection(const MCSymbol *Function, - MCContext &Context) { - const MCSectionCOFF *PData = +MCSection *UnwindEmitter::getPDataSection(const MCSymbol *Function, + MCContext &Context) { + MCSectionCOFF *PData = cast(Context.getObjectFileInfo()->getPDataSection()); return getUnwindInfoSection(".pdata", PData, Function, Context); } -const MCSection *UnwindEmitter::getXDataSection(const MCSymbol *Function, - MCContext &Context) { - const MCSectionCOFF *XData = +MCSection *UnwindEmitter::getXDataSection(const MCSymbol *Function, + MCContext &Context) { + MCSectionCOFF *XData = cast(Context.getObjectFileInfo()->getXDataSection()); return getUnwindInfoSection(".xdata", XData, Function, Context); } -- cgit v1.2.3