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
This commit is contained in:
Evan Cheng 2006-10-26 19:18:18 +00:00
parent 8d8c5976ab
commit 8910c1cacb
2 changed files with 10 additions and 1 deletions

View File

@ -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!");
}

View File

@ -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())