Skip to content

Commit 94f7af1

Browse files
committed
Derive IsVirtual from the given attributes
1 parent a5e31c1 commit 94f7af1

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

llvm/include/llvm/MC/MCContext.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,7 @@ class MCContext {
608608
MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
609609
GOFF::SDAttr SDAttributes);
610610
MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
611-
GOFF::EDAttr EDAttributes, MCSection *Parent,
612-
bool IsVirtual);
611+
GOFF::EDAttr EDAttributes, MCSection *Parent);
613612
MCSectionGOFF *getGOFFSection(SectionKind Kind, StringRef Name,
614613
GOFF::PRAttr PRAttributes, MCSection *Parent);
615614

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2801,8 +2801,7 @@ MCSection *TargetLoweringObjectFileGOFF::getSectionForLSDA(
28012801
GOFF::ESD_TS_ByteOriented, GOFF::ESD_BA_Merge,
28022802
GOFF::LOADBEHAVIOR, GOFF::ESD_RQ_0, GOFF::ESD_ALIGN_Fullword,
28032803
0},
2804-
static_cast<MCSectionGOFF *>(TextSection)->getParent(),
2805-
/*IsVirtual=*/true);
2804+
static_cast<MCSectionGOFF *>(TextSection)->getParent());
28062805
return getContext().getGOFFSection(SectionKind::getData(), Name,
28072806
GOFF::PRAttr{true, GOFF::ESD_EXE_DATA,
28082807
GOFF::LINKAGE,
@@ -2834,7 +2833,7 @@ MCSection *TargetLoweringObjectFileGOFF::SelectSectionForGlobal(
28342833
GOFF::EDAttr{false, GOFF::RMODE, GOFF::ESD_NS_Parts,
28352834
GOFF::ESD_TS_ByteOriented, GOFF::ESD_BA_Merge,
28362835
GOFF::ESD_LB_Deferred, GOFF::ESD_RQ_0, Align, 0},
2837-
SD, /*IsVirtual=*/true);
2836+
SD);
28382837
return getContext().getGOFFSection(Kind, Symbol->getName(),
28392838
GOFF::PRAttr{false, GOFF::ESD_EXE_DATA,
28402839
GOFF::LINKAGE,

llvm/lib/MC/MCContext.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,10 @@ MCSectionGOFF *MCContext::getGOFFSection(SectionKind Kind, StringRef Name,
705705

706706
MCSectionGOFF *MCContext::getGOFFSection(SectionKind Kind, StringRef Name,
707707
GOFF::EDAttr EDAttributes,
708-
MCSection *Parent, bool IsVirtual) {
709-
return getGOFFSection<GOFF::EDAttr>(Kind, Name, EDAttributes, Parent,
710-
IsVirtual);
708+
MCSection *Parent) {
709+
return getGOFFSection<GOFF::EDAttr>(
710+
Kind, Name, EDAttributes, Parent,
711+
/*IsVirtual=*/EDAttributes.BindAlgorithm == GOFF::ESD_BA_Merge);
711712
}
712713

713714
MCSectionGOFF *MCContext::getGOFFSection(SectionKind Kind, StringRef Name,

llvm/lib/MC/MCObjectFileInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
557557
GOFF::ESD_TS_ByteOriented, GOFF::ESD_BA_Merge,
558558
GOFF::ESD_LB_Deferred, GOFF::ESD_RQ_1,
559559
GOFF::ESD_ALIGN_Quadword, 0},
560-
RootSDSection, /*IsVirtual=*/true);
560+
RootSDSection);
561561
ADASection = Ctx->getGOFFSection(SectionKind::getData(), "#S",
562562
GOFF::PRAttr{false, GOFF::ESD_EXE_DATA,
563563
GOFF::ESD_LT_XPLink,
@@ -570,14 +570,14 @@ void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
570570
GOFF::ESD_TS_ByteOriented, GOFF::ESD_BA_Concatenate,
571571
GOFF::ESD_LB_Initial, GOFF::ESD_RQ_0,
572572
GOFF::ESD_ALIGN_Doubleword, 0},
573-
RootSDSection, /*IsVirtual=*/false);
573+
RootSDSection);
574574
MCSectionGOFF *PPA2ListEDSection = Ctx->getGOFFSection(
575575
SectionKind::getMetadata(), GOFF::CLASS_PPA2,
576576
GOFF::EDAttr{true, GOFF::RMODE, GOFF::ESD_NS_Parts,
577577
GOFF::ESD_TS_ByteOriented, GOFF::ESD_BA_Merge,
578578
GOFF::ESD_LB_Initial, GOFF::ESD_RQ_0,
579579
GOFF::ESD_ALIGN_Doubleword, 0},
580-
RootSDSection, /*IsVirtual=*/true);
580+
RootSDSection);
581581
PPA2ListSection = Ctx->getGOFFSection(SectionKind::getData(), ".&ppa2",
582582
GOFF::PRAttr{true, GOFF::ESD_EXE_DATA,
583583
GOFF::ESD_LT_OS,
@@ -590,7 +590,7 @@ void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
590590
GOFF::ESD_TS_Structured, GOFF::ESD_BA_Concatenate,
591591
GOFF::ESD_LB_NoLoad, GOFF::ESD_RQ_0,
592592
GOFF::ESD_ALIGN_Doubleword, 0},
593-
RootSDSection, /*IsVirtual=*/false);
593+
RootSDSection);
594594
}
595595

596596
void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {

0 commit comments

Comments
 (0)