Unbreak non-X86 targets from fallout caused by r261462

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2016-02-21 01:40:04 +00:00
parent 36935fd5b1
commit 9f1a234a23
5 changed files with 15 additions and 8 deletions

View File

@ -140,11 +140,13 @@ bool MipsTargetObjectFile::IsConstantInSmallSection(
}
/// Return true if this constant should be placed into small data section.
MCSection *MipsTargetObjectFile::getSectionForConstant(
const DataLayout &DL, SectionKind Kind, const Constant *C) const {
MCSection *MipsTargetObjectFile::getSectionForConstant(const DataLayout &DL,
SectionKind Kind,
const Constant *C,
unsigned &Align) const {
if (IsConstantInSmallSection(DL, C, *TM))
return SmallDataSection;
// Otherwise, we work the same as ELF.
return TargetLoweringObjectFileELF::getSectionForConstant(DL, Kind, C);
return TargetLoweringObjectFileELF::getSectionForConstant(DL, Kind, C, Align);
}

View File

@ -40,7 +40,8 @@ class MipsTargetMachine;
const TargetMachine &TM) const;
MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
const Constant *C) const override;
const Constant *C,
unsigned &Align) const override;
};
} // end namespace llvm

View File

@ -87,7 +87,8 @@ public:
}
MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
const Constant *C) const override {
const Constant *C,
unsigned &Align) const override {
return ReadOnlySection;
}

View File

@ -145,8 +145,10 @@ XCoreTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
report_fatal_error("Target does not support TLS or Common sections");
}
MCSection *XCoreTargetObjectFile::getSectionForConstant(
const DataLayout &DL, SectionKind Kind, const Constant *C) const {
MCSection *XCoreTargetObjectFile::getSectionForConstant(const DataLayout &DL,
SectionKind Kind,
const Constant *C,
unsigned &Align) const {
if (Kind.isMergeableConst4()) return MergeableConst4Section;
if (Kind.isMergeableConst8()) return MergeableConst8Section;
if (Kind.isMergeableConst16()) return MergeableConst16Section;

View File

@ -34,7 +34,8 @@ static const unsigned CodeModelLargeSize = 256;
const TargetMachine &TM) const override;
MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
const Constant *C) const override;
const Constant *C,
unsigned &Align) const override;
};
} // end namespace llvm