Add explicit #includes of <iostream>
[oota-llvm.git] / lib / Target / X86 / X86IntelAsmPrinter.cpp
index 6a8fcabe9755d0963dca6eadcf0bb33d420ce6b4..2b91870e42ac41fc81177fc400b46948b7d67cc1 100755 (executable)
@@ -29,13 +29,13 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &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);
   O << "\t.globl\t" << CurrentFnName << "\n";
-  if (!forCygwin && !forDarwin)
+  if (HasDotTypeDotSizeDirective)
     O << "\t.type\t" << CurrentFnName << ", @function\n";
   O << CurrentFnName << ":\n";
 
@@ -59,8 +59,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   return false;
 }
 
-void X86IntelAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op,
-                                  MVT::ValueType VT) {
+void X86IntelAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op) {
   unsigned char value = MI->getOperand(Op).getImmedValue();
   assert(value <= 7 && "Invalid ssecc argument!");
   switch (value) {
@@ -106,7 +105,7 @@ void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
     return;
   }
   case MachineOperand::MO_PCRelativeDisp:
-    std::cerr << "Shouldn't use addPCDisp() when building X86 MachineInstrs";
+    assert(0 && "Shouldn't use addPCDisp() when building X86 MachineInstrs");
     abort ();
     return;
   case MachineOperand::MO_GlobalAddress: {
@@ -117,7 +116,7 @@ void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
     if (Offset > 0)
       O << " + " << Offset;
     else if (Offset < 0)
-      O << " - " << -Offset;
+      O << Offset;
     return;
   }
   case MachineOperand::MO_ExternalSymbol:
@@ -143,7 +142,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()) {