Undo most of r54519.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54534 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 978f5cf..749cb71 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -51,15 +51,14 @@
}
const Section*
-DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
- bool NoCoalesce) const {
+DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
SectionKind::Kind Kind = SectionKindForGlobal(GV);
- bool CanCoalesce = !NoCoalesce && GV->isWeakForLinker();
+ bool isWeak = GV->isWeakForLinker();
bool isNonStatic = (DTM->getRelocationModel() != Reloc::Static);
switch (Kind) {
case SectionKind::Text:
- if (CanCoalesce)
+ if (isWeak)
return TextCoalSection;
else
return getTextSection_();
@@ -68,18 +67,18 @@
case SectionKind::BSS:
case SectionKind::ThreadBSS:
if (cast<GlobalVariable>(GV)->isConstant())
- return (CanCoalesce ? ConstDataCoalSection : ConstDataSection);
+ return (isWeak ? ConstDataCoalSection : ConstDataSection);
else
- return (CanCoalesce ? DataCoalSection : getDataSection_());
+ return (isWeak ? DataCoalSection : getDataSection_());
case SectionKind::ROData:
- return (CanCoalesce ? ConstDataCoalSection :
+ return (isWeak ? ConstDataCoalSection :
(isNonStatic ? ConstDataSection : getReadOnlySection_()));
case SectionKind::RODataMergeStr:
- return (CanCoalesce ?
+ return (isWeak ?
ConstDataCoalSection :
MergeableStringSection(cast<GlobalVariable>(GV)));
case SectionKind::RODataMergeConst:
- return (CanCoalesce ?
+ return (isWeak ?
ConstDataCoalSection:
MergeableConstSection(cast<GlobalVariable>(GV)));
default: