diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-05-21 19:20:38 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-05-21 19:20:38 +0000 |
commit | 7521964d28c5ccb28431aed23334638138d9bd0a (patch) | |
tree | d078ea9603b8b1a55f5f942ec61596e700977664 /lib/MC/MCWinEH.cpp | |
parent | 4c919af33596ae54b3c66220ad5b8b3baee0151e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCWinEH.cpp')
-rw-r--r-- | lib/MC/MCWinEH.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/MC/MCWinEH.cpp b/lib/MC/MCWinEH.cpp index b1c95f800cf..d5d9eadf39a 100644 --- a/lib/MC/MCWinEH.cpp +++ b/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<MCSectionCOFF>(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<MCSectionCOFF>(Context.getObjectFileInfo()->getXDataSection()); return getUnwindInfoSection(".xdata", XData, Function, Context); } |