forked from OSchip/llvm-project
Put cstrings in .cstring section when compiling for Mac OS X.
llvm-svn: 31203
This commit is contained in:
parent
684ba840eb
commit
392f645783
|
@ -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!");
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue