Put cstrings in .cstring section when compiling for Mac OS X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31203 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index 5e13a35..0a4106c 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -204,9 +204,17 @@
// If external or appending, declare as a global symbol
O << "\t.globl " << name << "\n";
// FALL THROUGH
- case GlobalValue::InternalLinkage:
+ case GlobalValue::InternalLinkage: {
+ if (TAI->getCStringSection()) {
+ const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
+ if (CVA && CVA->isCString()) {
+ SwitchToDataSection(TAI->getCStringSection(), I);
+ break;
+ }
+ }
SwitchToDataSection(TAI->getDataSection(), I);
break;
+ }
default:
assert(0 && "Unknown linkage type!");
}