From df8c7faf6039780b448c399ff7f909f39044dc5a Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 8 Aug 2008 17:56:50 +0000 Subject: Undo most of r54519. llvm-svn: 54534 --- llvm/lib/Target/DarwinTargetAsmInfo.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'llvm/lib/Target/DarwinTargetAsmInfo.cpp') diff --git a/llvm/lib/Target/DarwinTargetAsmInfo.cpp b/llvm/lib/Target/DarwinTargetAsmInfo.cpp index 978f5cf36ac..749cb717943 100644 --- a/llvm/lib/Target/DarwinTargetAsmInfo.cpp +++ b/llvm/lib/Target/DarwinTargetAsmInfo.cpp @@ -51,15 +51,14 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) { } 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 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV, case SectionKind::BSS: case SectionKind::ThreadBSS: if (cast(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(GV))); case SectionKind::RODataMergeConst: - return (CanCoalesce ? + return (isWeak ? ConstDataCoalSection: MergeableConstSection(cast(GV))); default: -- cgit v1.2.3