Doh. Must check if GV is constant first before putting it in .cstring.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 28 Oct 2006 05:56:51 +0000 (05:56 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 28 Oct 2006 05:56:51 +0000 (05:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31253 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCAsmPrinter.cpp

index bfea893a9b2ce27a528fed310467cb0c1c9d641e..21c2f740af822d8a0c19ed438dd9825a8687f3af 100644 (file)
@@ -548,9 +548,9 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
         O << "\t.globl " << name << "\n";
         // FALL THROUGH
       case GlobalValue::InternalLinkage:
-        if (TAI->getCStringSection()) {
+        if (I->isConstant()) {
           const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
-          if (CVA && CVA->isCString()) {
+          if (TAI->getCStringSection() && CVA && CVA->isCString()) {
             SwitchToDataSection(TAI->getCStringSection(), I);
             break;
           }