aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-10-26 19:18:18 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-10-26 19:18:18 +0000
commit8910c1cacb116dfd9d854572512b5298274ff7e7 (patch)
tree209ffe45627438a14586f272f59d314a8f0e14e1 /lib/Target/X86
parent8d8c5976ab4aadb6011d4604e3fbf81ba682b912 (diff)
downloadexternal_llvm-8910c1cacb116dfd9d854572512b5298274ff7e7.zip
external_llvm-8910c1cacb116dfd9d854572512b5298274ff7e7.tar.gz
external_llvm-8910c1cacb116dfd9d854572512b5298274ff7e7.tar.bz2
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
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/X86AsmPrinter.cpp10
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp1
2 files changed, 10 insertions, 1 deletions
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 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
// 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!");
}
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index cf08548..e677737 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -32,6 +32,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
PrivateGlobalPrefix = "L"; // Marker for constant pool idxs
ConstantPoolSection = "\t.const\n";
JumpTableDataSection = "\t.const\n";
+ CStringSection = "\t.cstring";
FourByteConstantSection = "\t.literal4\n";
EightByteConstantSection = "\t.literal8\n";
if (Subtarget->is64Bit())