forked from OSchip/llvm-project
parent
0d982f9a8a
commit
5626b88047
|
@ -39,10 +39,11 @@ namespace llvm {
|
||||||
SectionKind::Kind kind) const;
|
SectionKind::Kind kind) const;
|
||||||
virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
|
virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
|
||||||
Mangler *Mang) const;
|
Mangler *Mang) const;
|
||||||
const Section* MergeableConstSection(const GlobalVariable *GV) const;
|
const Section* SelectSectionForMachineConst(const Type *Ty) const;
|
||||||
|
|
||||||
|
private:
|
||||||
const Section* MergeableConstSection(const Type *Ty) const;
|
const Section* MergeableConstSection(const Type *Ty) const;
|
||||||
const Section* MergeableStringSection(const GlobalVariable *GV) const;
|
const Section* MergeableStringSection(const GlobalVariable *GV) const;
|
||||||
const Section* SelectSectionForMachineConst(const Type *Ty) const;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,6 @@ namespace llvm {
|
||||||
SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const;
|
SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const;
|
||||||
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
|
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
|
||||||
virtual std::string printSectionFlags(unsigned flags) const;
|
virtual std::string printSectionFlags(unsigned flags) const;
|
||||||
const Section* MergeableConstSection(const Type *Ty) const;
|
|
||||||
const Section* MergeableStringSection(const GlobalVariable *GV) const;
|
|
||||||
virtual const Section*
|
virtual const Section*
|
||||||
SelectSectionForMachineConst(const Type *Ty) const;
|
SelectSectionForMachineConst(const Type *Ty) const;
|
||||||
|
|
||||||
|
@ -37,6 +35,10 @@ namespace llvm {
|
||||||
const Section* DataRelLocalSection;
|
const Section* DataRelLocalSection;
|
||||||
const Section* DataRelROSection;
|
const Section* DataRelROSection;
|
||||||
const Section* DataRelROLocalSection;
|
const Section* DataRelROLocalSection;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const Section* MergeableConstSection(const Type *Ty) const;
|
||||||
|
const Section* MergeableStringSection(const GlobalVariable *GV) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,9 +156,9 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
|
||||||
ConstTextCoalSection :
|
ConstTextCoalSection :
|
||||||
MergeableStringSection(cast<GlobalVariable>(GV)));
|
MergeableStringSection(cast<GlobalVariable>(GV)));
|
||||||
case SectionKind::RODataMergeConst:
|
case SectionKind::RODataMergeConst:
|
||||||
return (isWeak ?
|
if (isWeak) return ConstDataCoalSection;
|
||||||
ConstDataCoalSection:
|
return MergeableConstSection(cast<GlobalVariable>(GV)
|
||||||
MergeableConstSection(cast<GlobalVariable>(GV)));
|
->getInitializer()->getType());
|
||||||
default:
|
default:
|
||||||
llvm_unreachable("Unsuported section kind for global");
|
llvm_unreachable("Unsuported section kind for global");
|
||||||
}
|
}
|
||||||
|
@ -184,13 +184,6 @@ DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
const Section*
|
const Section*
|
||||||
DarwinTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
|
|
||||||
Constant *C = GV->getInitializer();
|
|
||||||
|
|
||||||
return MergeableConstSection(C->getType());
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const Section*
|
|
||||||
DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
|
DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
|
||||||
const TargetData *TD = TM.getTargetData();
|
const TargetData *TD = TM.getTargetData();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue