summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp')
-rw-r--r--gnu/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/gnu/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp b/gnu/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
index abe1deddc56..ad8693fd325 100644
--- a/gnu/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
+++ b/gnu/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
@@ -95,11 +95,9 @@ static unsigned getXCoreSectionFlags(SectionKind K, bool IsCPRel) {
return Flags;
}
-MCSection *
-XCoreTargetObjectFile::getExplicitSectionGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler &Mang,
- const TargetMachine &TM) const {
- StringRef SectionName = GV->getSection();
+MCSection *XCoreTargetObjectFile::getExplicitSectionGlobal(
+ const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
+ StringRef SectionName = GO->getSection();
// Infer section flags from the section name if we can.
bool IsCPRel = SectionName.startswith(".cp.");
if (IsCPRel && !Kind.isReadOnly())
@@ -108,12 +106,10 @@ XCoreTargetObjectFile::getExplicitSectionGlobal(const GlobalValue *GV,
getXCoreSectionFlags(Kind, IsCPRel));
}
-MCSection *
-XCoreTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler &Mang,
- const TargetMachine &TM) const {
+MCSection *XCoreTargetObjectFile::SelectSectionForGlobal(
+ const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
- bool UseCPRel = GV->isLocalLinkage(GV->getLinkage());
+ bool UseCPRel = GO->hasLocalLinkage();
if (Kind.isText()) return TextSection;
if (UseCPRel) {
@@ -122,8 +118,8 @@ XCoreTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
if (Kind.isMergeableConst8()) return MergeableConst8Section;
if (Kind.isMergeableConst16()) return MergeableConst16Section;
}
- Type *ObjType = GV->getValueType();
- auto &DL = GV->getParent()->getDataLayout();
+ Type *ObjType = GO->getValueType();
+ auto &DL = GO->getParent()->getDataLayout();
if (TM.getCodeModel() == CodeModel::Small || !ObjType->isSized() ||
DL.getTypeAllocSize(ObjType) < CodeModelLargeSize) {
if (Kind.isReadOnly()) return UseCPRel? ReadOnlySection