Start using PrivateGlobalPrefix correctly
authorChris Lattner <sabre@nondot.org>
Mon, 21 Nov 2005 06:51:52 +0000 (06:51 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Nov 2005 06:51:52 +0000 (06:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24442 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaAsmPrinter.cpp
lib/Target/IA64/IA64AsmPrinter.cpp

index 9581c0c532e26b218c7c4d581d12a3bbb480f264..e902b2d597f66eb774d6c8e2c391d894e9cca42a 100644 (file)
@@ -43,6 +43,7 @@ namespace {
        : AsmPrinter(o, tm), LabelNumber(0)
     {
       AlignmentIsInBytes = false;
+      PrivateGlobalPrefix = "$";
     }
 
     /// We name each basic block in a Function with a unique number, so
@@ -131,7 +132,8 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) {
   }
 
   case MachineOperand::MO_ConstantPoolIndex:
-    O << "$CPI" << CurrentFnName << "_" << MO.getConstantPoolIndex();
+    O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_"
+      << MO.getConstantPoolIndex();
     return;
 
   case MachineOperand::MO_ExternalSymbol:
@@ -222,8 +224,8 @@ void AlphaAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
   for (unsigned i = 0, e = CP.size(); i != e; ++i) {
     //    SwitchSection(O, "section .rodata, \"dr\"");
     emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
-    O << "$CPI" << CurrentFnName << "_" << i << ":\t\t\t\t\t" << CommentString
-      << *CP[i] << "\n";
+    O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" << i 
+      << ":\t\t\t\t\t" << CommentString << *CP[i] << "\n";
     emitGlobalConstant(CP[i]);
   }
 }
index d96a10a08ff76b5f84b39f6d6c85c8d1e4597763..b024a0f21c312d375b86663b5bec5ada8c3f57af 100644 (file)
@@ -88,8 +88,8 @@ void IA64SharedAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
       // FIXME: would be nice to have rodata (no 'w') when appropriate?
   for (unsigned i = 0, e = CP.size(); i != e; ++i) {
     emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
-    O << ".CPI" << CurrentFnName << "_" << i << ":\t\t\t\t\t" << CommentString
-      << *CP[i] << "\n";
+    O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" << i
+      << ":\t\t\t\t\t" << CommentString << *CP[i] << "\n";
     emitGlobalConstant(CP[i]);
   }
 }
@@ -357,7 +357,7 @@ void IA64AsmPrinter::printOp(const MachineOperand &MO,
     return;
 
   case MachineOperand::MO_ConstantPoolIndex: {
-    O << "@gprel(.CPI" << CurrentFnName << "_"
+    O << "@gprel(" << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_"
       << MO.getConstantPoolIndex() << ")";
     return;
   }