Use HasDotTypeDotSizeDirective instead of forELF
[oota-llvm.git] / lib / Target / X86 / X86IntelAsmPrinter.cpp
index 71dc0b2821a983b6548b2234c61678e30dbd792e..e54328bb25de48f8917d40030a023625f17533bd 100755 (executable)
@@ -25,17 +25,17 @@ using namespace x86;
 /// method to print assembly for each instruction.
 ///
 bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
-  setupMachineFunction(MF);
+  SetupMachineFunction(MF);
   O << "\n\n";
 
   // Print out constants referenced by the function
-  printConstantPool(MF.getConstantPool());
+  EmitConstantPool(MF.getConstantPool());
 
   // Print out labels for the function.
   SwitchSection("\t.text\n", MF.getFunction());
-  emitAlignment(4);
+  EmitAlignment(4);
   O << "\t.globl\t" << CurrentFnName << "\n";
-  if (!forCygwin && !forDarwin)
+  if (HasDotTypeDotSizeDirective)
     O << "\t.type\t" << CurrentFnName << ", @function\n";
   O << CurrentFnName << ":\n";
 
@@ -44,7 +44,8 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
        I != E; ++I) {
     // Print a label for the basic block if there are any predecessors.
     if (I->pred_begin() != I->pred_end())
-      O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t"
+      O << PrivateGlobalPrefix << "BB" << CurrentFnName << "_" << I->getNumber()
+        << ":\t"
         << CommentString << " " << I->getBasicBlock()->getName() << "\n";
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
@@ -98,7 +99,8 @@ void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
     return;
   case MachineOperand::MO_MachineBasicBlock: {
     MachineBasicBlock *MBBOp = MO.getMachineBasicBlock();
-    O << ".LBB" << Mang->getValueName(MBBOp->getParent()->getFunction())
+    O << PrivateGlobalPrefix << "BB"
+      << Mang->getValueName(MBBOp->getParent()->getFunction())
       << "_" << MBBOp->getNumber () << "\t# "
       << MBBOp->getBasicBlock ()->getName ();
     return;
@@ -141,7 +143,7 @@ void X86IntelAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op){
     O << "]";
     return;
   } else if (BaseReg.isConstantPoolIndex()) {
-    O << "[" << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_"
+    O << "[" << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_"
       << BaseReg.getConstantPoolIndex();
 
     if (IndexReg.getReg()) {