diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-08-08 17:56:50 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-08-08 17:56:50 +0000 |
commit | df8c7faf6039780b448c399ff7f909f39044dc5a (patch) | |
tree | 734b0f07d301bbe1f7c0c8cedc4635b67e1ffe9a /llvm/lib/Target/DarwinTargetAsmInfo.cpp | |
parent | 5bb8f2264b95a4792bd87f2e024e85827c3b1f1d (diff) | |
download | bcm5719-llvm-df8c7faf6039780b448c399ff7f909f39044dc5a.tar.gz bcm5719-llvm-df8c7faf6039780b448c399ff7f909f39044dc5a.zip |
Undo most of r54519.
llvm-svn: 54534
Diffstat (limited to 'llvm/lib/Target/DarwinTargetAsmInfo.cpp')
-rw-r--r-- | llvm/lib/Target/DarwinTargetAsmInfo.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
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<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: |