SectionKind::Kind kind) const;
virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
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* MergeableStringSection(const GlobalVariable *GV) const;
- const Section* SelectSectionForMachineConst(const Type *Ty) const;
};
}
SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const;
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) 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*
SelectSectionForMachineConst(const Type *Ty) const;
const Section* DataRelLocalSection;
const Section* DataRelROSection;
const Section* DataRelROLocalSection;
+
+ private:
+ const Section* MergeableConstSection(const Type *Ty) const;
+ const Section* MergeableStringSection(const GlobalVariable *GV) const;
};
}
ConstTextCoalSection :
MergeableStringSection(cast<GlobalVariable>(GV)));
case SectionKind::RODataMergeConst:
- return (isWeak ?
- ConstDataCoalSection:
- MergeableConstSection(cast<GlobalVariable>(GV)));
+ if (isWeak) return ConstDataCoalSection;
+ return MergeableConstSection(cast<GlobalVariable>(GV)
+ ->getInitializer()->getType());
default:
llvm_unreachable("Unsuported section kind for global");
}
}
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 {
const TargetData *TD = TM.getTargetData();