mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 17:31:50 +00:00
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:
parent
36935fd5b1
commit
9f1a234a23
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user