Place cstrings in .cstring section.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 26 Oct 2006 21:48:57 +0000 (21:48 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 26 Oct 2006 21:48:57 +0000 (21:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31207 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCTargetAsmInfo.cpp

index a7086975f056873f640cbe127b3b0fb497e5e10b..bfea893a9b2ce27a528fed310467cb0c1c9d641e 100644 (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:
index cecffbabf1cd414a4eec7df72627c83a5c054857..f8848f592c5531982d147ae99811caee796a1ad7 100644 (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";