[llvm-commits] [llvm] r51458 - /llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
Dale Johannesen
dalej at apple.com
Thu May 22 17:17:00 PDT 2008
Author: johannes
Date: Thu May 22 19:16:59 2008
New Revision: 51458
URL: http://llvm.org/viewvc/llvm-project?rev=51458&view=rev
Log:
Put const weak stuff in appropriate section on Darwin.
g++.dg/abi/key2.C
Modified:
llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=51458&r1=51457&r2=51458&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Thu May 22 19:16:59 2008
@@ -251,7 +251,15 @@
if (Subtarget->isTargetDarwin()) {
O << "\t.globl " << name << "\n"
<< TAI->getWeakDefDirective() << name << "\n";
- SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
+ if (!I->isConstant())
+ SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
+ else {
+ const ArrayType *AT = dyn_cast<ArrayType>(Type);
+ if (AT && AT->getElementType()==Type::Int8Ty)
+ SwitchToDataSection("\t.section __TEXT,__const_coal,coalesced", I);
+ else
+ SwitchToDataSection("\t.section __DATA,__const_coal,coalesced", I);
+ }
} else if (Subtarget->isTargetCygMing()) {
std::string SectionName(".section\t.data$linkonce." +
name +
More information about the llvm-commits
mailing list