Fixe typos and 80 column size problems
[oota-llvm.git] / lib / Target / Mips / MipsAsmPrinter.cpp
index dc3242c0f1c4d3f65e1623b0efbc9725b19ccda9..178ca141b0a2c6b5d37a2736c6be09a9d5187c1a 100644 (file)
@@ -32,7 +32,6 @@
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Support/Mangler.h"
 #include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/CommandLine.h"
@@ -63,6 +62,8 @@ namespace {
     void printOperand(const MachineInstr *MI, int opNum);
     void printMemOperand(const MachineInstr *MI, int opNum, 
                          const char *Modifier = 0);
+    void printFCCOperand(const MachineInstr *MI, int opNum, 
+                         const char *Modifier = 0);
 
     unsigned int getSavedRegsBitmask(bool isFloat, MachineFunction &MF);
     void printHex32(unsigned int Value);
@@ -147,7 +148,7 @@ emitMaskDirective(MachineFunction &MF)
   O << "," << Offset << "\n";
 }
 
-/// TODO: Mask Directive for Float Point
+/// TODO: Mask Directive for Floating Point
 void MipsAsmPrinter::
 emitFMaskDirective(MachineFunction &MF)
 {
@@ -190,14 +191,14 @@ emitSetDirective(SetDirectiveFlags Flag)
 }  
 
 // Create a bitmask with all callee saved registers for CPU
-// or Float Point registers. For CPU registers consider RA,
+// or Floating Point registers. For CPU registers consider RA,
 // GP and FP for saving if necessary.
 unsigned int MipsAsmPrinter::
 getSavedRegsBitmask(bool isFloat, MachineFunction &MF)
 {
   const TargetRegisterInfo &RI = *TM.getRegisterInfo();
              
-  // Float Point Registers, TODO
+  // Floating Point Registers, TODO
   if (isFloat)
     return 0;
 
@@ -297,7 +298,7 @@ runOnMachineFunction(MachineFunction &MF)
 
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true);
+      printBasicBlockLabel(I, true, true);
       O << '\n';
     }
 
@@ -429,6 +430,13 @@ printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier)
   O << ")";
 }
 
+void MipsAsmPrinter::
+printFCCOperand(const MachineInstr *MI, int opNum, const char *Modifier) 
+{
+  const MachineOperand& MO = MI->getOperand(opNum);
+  O << Mips::MipsFCCToString((Mips::CondCode)MO.getImm()); 
+}
+
 bool MipsAsmPrinter::
 doInitialization(Module &M) 
 {
@@ -461,7 +469,8 @@ doFinalization(Module &M)
 
       // Is this correct ?
       if (C->isNullValue() && (I->hasLinkOnceLinkage() || 
-          I->hasInternalLinkage() || I->hasWeakLinkage())) 
+          I->hasInternalLinkage() || I->hasWeakLinkage() ||
+          I->hasCommonLinkage()))
       {
         if (Size == 0) Size = 1;   // .comm Foo, 0 is undefined, avoid it.
 
@@ -487,7 +496,8 @@ doFinalization(Module &M)
         switch (I->getLinkage()) 
         {
           case GlobalValue::LinkOnceLinkage:
-          case GlobalValue::WeakLinkage:   
+          case GlobalValue::CommonLinkage:
+          case GlobalValue::WeakLinkage:
             // FIXME: Verify correct for weak.
             // Nonnull linkonce -> weak
             O << "\t.weak " << name << "\n";
@@ -545,5 +555,7 @@ doFinalization(Module &M)
     }
   }
 
+  O << "\n";
+
   return AsmPrinter::doFinalization(M);
 }