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 | |
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')
-rw-r--r-- | llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/DarwinTargetAsmInfo.cpp | 17 | ||||
-rw-r--r-- | llvm/lib/Target/ELFTargetAsmInfo.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetAsmInfo.h | 3 | ||||
-rw-r--r-- | llvm/lib/Target/TargetAsmInfo.cpp | 8 |
6 files changed, 17 insertions, 21 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index 420ccd0bcc9..8af79de902e 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -863,8 +863,7 @@ void ARMAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { return; } - bool NoCoalesc = PCRelGVs.count(GVar); - std::string SectionName = TAI->SectionForGlobal(GVar, NoCoalesc); + std::string SectionName = TAI->SectionForGlobal(GVar); std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); const Type *Type = C->getType(); @@ -901,7 +900,7 @@ void ARMAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (TAI->getLCOMMDirective() != NULL) { - if (NoCoalesc || GVar->hasInternalLinkage()) { + if (PCRelGVs.count(GVar) || GVar->hasInternalLinkage()) { O << TAI->getLCOMMDirective() << name << "," << Size; if (Subtarget->isTargetDarwin()) O << "," << Align; 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: diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp index 523527c7b6d..82ac847e845 100644 --- a/llvm/lib/Target/ELFTargetAsmInfo.cpp +++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp @@ -40,8 +40,7 @@ ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) { } const Section* -ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV, - bool NoCoalesce) const { +ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind Kind = SectionKindForGlobal(GV); if (const Function *F = dyn_cast<Function>(GV)) { diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp index eff69abc6db..04edd0d4b53 100644 --- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp +++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.cpp @@ -82,7 +82,7 @@ SectionKindForGlobal(const GlobalValue *GV) const { } const Section* MipsTargetAsmInfo:: -SelectSectionForGlobal(const GlobalValue *GV, bool NoCoalesce) const { +SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind K = SectionKindForGlobal(GV); const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV); diff --git a/llvm/lib/Target/Mips/MipsTargetAsmInfo.h b/llvm/lib/Target/Mips/MipsTargetAsmInfo.h index 806cda8be36..2b5a739e721 100644 --- a/llvm/lib/Target/Mips/MipsTargetAsmInfo.h +++ b/llvm/lib/Target/Mips/MipsTargetAsmInfo.h @@ -40,8 +40,7 @@ namespace llvm { SectionFlagsForGlobal(const GlobalValue *GV = NULL, const char* name = NULL) const; - virtual const Section* SelectSectionForGlobal(const GlobalValue *GV, - bool NoCoalesce) const; + virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; private: const MipsSubtarget *Subtarget; diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp index cf431126349..9bc0b4055e3 100644 --- a/llvm/lib/Target/TargetAsmInfo.cpp +++ b/llvm/lib/Target/TargetAsmInfo.cpp @@ -272,7 +272,7 @@ TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV, } std::string -TargetAsmInfo::SectionForGlobal(const GlobalValue *GV, bool NoCoalesce) const { +TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { const Section* S; // Select section name if (GV->hasSection()) { @@ -282,7 +282,7 @@ TargetAsmInfo::SectionForGlobal(const GlobalValue *GV, bool NoCoalesce) const { S = getNamedSection(GV->getSection().c_str(), Flags); } else { // Use default section depending on the 'type' of global - S = SelectSectionForGlobal(GV, NoCoalesce); + S = SelectSectionForGlobal(GV); } if (!S->isNamed()) @@ -295,8 +295,8 @@ TargetAsmInfo::SectionForGlobal(const GlobalValue *GV, bool NoCoalesce) const { } // Lame default implementation. Calculate the section name for global. -const Section* TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV, - bool NoCoalesce) const { +const Section* +TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind Kind = SectionKindForGlobal(GV); if (GV->isWeakForLinker()) { |