diff options
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index f0f4516..49c9d46 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2157,8 +2157,9 @@ MCSection *TargetLoweringObjectFileXCOFF::getExplicitSectionGlobal( else report_fatal_error("XCOFF other section types not yet implemented."); - return getContext().getXCOFFSection(SectionName, MappingClass, XCOFF::XTY_SD, - Kind, /* MultiSymbolsAllowed*/ true); + return getContext().getXCOFFSection( + SectionName, Kind, XCOFF::CsectProperties(MappingClass, XCOFF::XTY_SD), + /* MultiSymbolsAllowed*/ true); } MCSection *TargetLoweringObjectFileXCOFF::getSectionForExternalReference( @@ -2171,8 +2172,9 @@ MCSection *TargetLoweringObjectFileXCOFF::getSectionForExternalReference( // Externals go into a csect of type ER. return getContext().getXCOFFSection( - Name, isa<Function>(GO) ? XCOFF::XMC_DS : XCOFF::XMC_UA, XCOFF::XTY_ER, - SectionKind::getMetadata()); + Name, SectionKind::getMetadata(), + XCOFF::CsectProperties(isa<Function>(GO) ? XCOFF::XMC_DS : XCOFF::XMC_UA, + XCOFF::XTY_ER)); } MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal( @@ -2183,8 +2185,9 @@ MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal( SmallString<128> Name; getNameWithPrefix(Name, GO, TM); return getContext().getXCOFFSection( - Name, Kind.isBSSLocal() ? XCOFF::XMC_BS : XCOFF::XMC_RW, XCOFF::XTY_CM, - Kind); + Name, Kind, + XCOFF::CsectProperties( + Kind.isBSSLocal() ? XCOFF::XMC_BS : XCOFF::XMC_RW, XCOFF::XTY_CM)); } if (Kind.isMergeableCString()) { @@ -2200,7 +2203,7 @@ MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal( getNameWithPrefix(Name, GO, TM); return getContext().getXCOFFSection( - Name, XCOFF::XMC_RO, XCOFF::XTY_SD, Kind, + Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_RO, XCOFF::XTY_SD), /* MultiSymbolsAllowed*/ !TM.getDataSections()); } @@ -2223,8 +2226,9 @@ MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal( if (TM.getDataSections()) { SmallString<128> Name; getNameWithPrefix(Name, GO, TM); - return getContext().getXCOFFSection(Name, XCOFF::XMC_RW, XCOFF::XTY_SD, - SectionKind::getData()); + return getContext().getXCOFFSection( + Name, SectionKind::getData(), + XCOFF::CsectProperties(XCOFF::XMC_RW, XCOFF::XTY_SD)); } return DataSection; } @@ -2233,8 +2237,9 @@ MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal( if (TM.getDataSections()) { SmallString<128> Name; getNameWithPrefix(Name, GO, TM); - return getContext().getXCOFFSection(Name, XCOFF::XMC_RO, XCOFF::XTY_SD, - SectionKind::getReadOnly()); + return getContext().getXCOFFSection( + Name, SectionKind::getReadOnly(), + XCOFF::CsectProperties(XCOFF::XMC_RO, XCOFF::XTY_SD)); } return ReadOnlySection; } @@ -2253,8 +2258,9 @@ MCSection *TargetLoweringObjectFileXCOFF::getSectionForJumpTable( // the table doesn't prevent the removal. SmallString<128> NameStr(".rodata.jmp.."); getNameWithPrefix(NameStr, &F, TM); - return getContext().getXCOFFSection(NameStr, XCOFF::XMC_RO, XCOFF::XTY_SD, - SectionKind::getReadOnly()); + return getContext().getXCOFFSection( + NameStr, SectionKind::getReadOnly(), + XCOFF::CsectProperties(XCOFF::XMC_RO, XCOFF::XTY_SD)); } bool TargetLoweringObjectFileXCOFF::shouldPutJumpTableInFunctionSection( @@ -2345,9 +2351,11 @@ MCSymbol *TargetLoweringObjectFileXCOFF::getFunctionEntryPointSymbol( Func->isDeclaration()) && isa<Function>(Func)) { return getContext() - .getXCOFFSection(NameStr, XCOFF::XMC_PR, - Func->isDeclaration() ? XCOFF::XTY_ER : XCOFF::XTY_SD, - SectionKind::getText()) + .getXCOFFSection( + NameStr, SectionKind::getText(), + XCOFF::CsectProperties(XCOFF::XMC_PR, Func->isDeclaration() + ? XCOFF::XTY_ER + : XCOFF::XTY_SD)) ->getQualNameSymbol(); } @@ -2358,8 +2366,9 @@ MCSection *TargetLoweringObjectFileXCOFF::getSectionForFunctionDescriptor( const Function *F, const TargetMachine &TM) const { SmallString<128> NameStr; getNameWithPrefix(NameStr, F, TM); - return getContext().getXCOFFSection(NameStr, XCOFF::XMC_DS, XCOFF::XTY_SD, - SectionKind::getData()); + return getContext().getXCOFFSection( + NameStr, SectionKind::getData(), + XCOFF::CsectProperties(XCOFF::XMC_DS, XCOFF::XTY_SD)); } MCSection *TargetLoweringObjectFileXCOFF::getSectionForTOCEntry( @@ -2367,7 +2376,8 @@ MCSection *TargetLoweringObjectFileXCOFF::getSectionForTOCEntry( // Use TE storage-mapping class when large code model is enabled so that // the chance of needing -bbigtoc is decreased. return getContext().getXCOFFSection( - cast<MCSymbolXCOFF>(Sym)->getSymbolTableName(), - TM.getCodeModel() == CodeModel::Large ? XCOFF::XMC_TE : XCOFF::XMC_TC, - XCOFF::XTY_SD, SectionKind::getData()); + cast<MCSymbolXCOFF>(Sym)->getSymbolTableName(), SectionKind::getData(), + XCOFF::CsectProperties( + TM.getCodeModel() == CodeModel::Large ? XCOFF::XMC_TE : XCOFF::XMC_TC, + XCOFF::XTY_SD)); } |