Place cstrings in .cstring section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31207 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-10-26 21:48:57 +00:00
parent abf6345710
commit 80aa9a122f
2 changed files with 9 additions and 0 deletions

View File

@ -548,6 +548,14 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
O << "\t.globl " << name << "\n";
// FALL THROUGH
case GlobalValue::InternalLinkage:
if (TAI->getCStringSection()) {
const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
if (CVA && CVA->isCString()) {
SwitchToDataSection(TAI->getCStringSection(), I);
break;
}
}
SwitchToDataSection("\t.data", I);
break;
default:

View File

@ -28,6 +28,7 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) {
AlignmentIsInBytes = false;
ConstantPoolSection = "\t.const\t";
JumpTableDataSection = ".const";
CStringSection = "\t.cstring";
LCOMMDirective = "\t.lcomm\t";
StaticCtorsSection = ".mod_init_func";
StaticDtorsSection = ".mod_term_func";