diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-24 03:49:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-24 03:49:17 +0000 |
commit | 07bd1cd8c5666fd94abeed60a7a24c5e15d30234 (patch) | |
tree | deabd5324f3c973f11ce07995fc3004f8438b159 /llvm/lib/Target/X86 | |
parent | 30ac7607be10a493078f4cacb40f17836b8e0c25 (diff) | |
download | bcm5719-llvm-07bd1cd8c5666fd94abeed60a7a24c5e15d30234.tar.gz bcm5719-llvm-07bd1cd8c5666fd94abeed60a7a24c5e15d30234.zip |
reduce api exposure: clients shouldn't call SectionKindForGlobal directly.
llvm-svn: 76941
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r-- | llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 1e505a670fe..74145dcfce0 100644 --- a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -773,9 +773,9 @@ void X86ATTAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { if (EmitSpecialLLVMGlobal(GVar)) { if (Subtarget->isTargetDarwin() && TM.getRelocationModel() == Reloc::Static) { - if (GVar->getName() == "llvm.global_ctors") + if (GVar->isName("llvm.global_ctors")) O << ".reference .constructors_used\n"; - else if (GVar->getName() == "llvm.global_dtors") + else if (GVar->isName("llvm.global_dtors")) O << ".reference .destructors_used\n"; } return; @@ -794,11 +794,12 @@ void X86ATTAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { if (Subtarget->isTargetELF()) O << "\t.type\t" << name << ",@object\n"; - SwitchToSection(TAI->SectionForGlobal(GVar)); + const Section *TheSection = TAI->SectionForGlobal(GVar); + SwitchToSection(TheSection); if (C->isNullValue() && !GVar->hasSection() && !(Subtarget->isTargetDarwin() && - TAI->SectionKindForGlobal(GVar) == SectionKind::RODataMergeStr)) { + TheSection->getFlags() == SectionKind::RODataMergeStr)) { // FIXME: This seems to be pretty darwin-specific if (GVar->hasExternalLinkage()) { if (const char *Directive = TAI->getZeroFillDirective()) { |