[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp AlphaLLRP.cpp AlphaTargetAsmInfo.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Thu Dec 7 15:56:10 PST 2006



Changes in directory llvm/lib/Target/Alpha:

AlphaAsmPrinter.cpp updated: 1.58 -> 1.59
AlphaLLRP.cpp updated: 1.5 -> 1.6
AlphaTargetAsmInfo.cpp updated: 1.4 -> 1.5
---
Log message:

Simplify a bit

---
Diffs of the changes:  (+15 -30)

 AlphaAsmPrinter.cpp    |   41 +++++++++++------------------------------
 AlphaLLRP.cpp          |    3 +++
 AlphaTargetAsmInfo.cpp |    1 +
 3 files changed, 15 insertions(+), 30 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp
diff -u llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.58 llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.59
--- llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.58	Thu Dec  7 16:21:48 2006
+++ llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp	Thu Dec  7 17:55:55 2006
@@ -33,20 +33,11 @@
 
     /// Unique incrementer for label values for referencing Global values.
     ///
-    unsigned LabelNumber;
 
     AlphaAsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T)
-       : AsmPrinter(o, tm, T), LabelNumber(0) {
+      : AsmPrinter(o, tm, T) {
     }
 
-    /// We name each basic block in a Function with a unique number, so
-    /// that we can consistently refer to them later. This is cleared
-    /// at the beginning of each call to runOnMachineFunction().
-    ///
-    typedef std::map<const Value *, unsigned> ValueMapTy;
-    ValueMapTy NumberForBB;
-    std::string CurSection;
-
     virtual const char *getPassName() const {
       return "Alpha Assembly Printer";
     }
@@ -54,7 +45,6 @@
     void printOp(const MachineOperand &MO, bool IsCallOp = false);
     void printOperand(const MachineInstr *MI, int opNum);
     void printBaseOffsetPair (const MachineInstr *MI, int i, bool brackets=true);
-    void printMachineInstruction(const MachineInstr *MI);
     bool runOnMachineFunction(MachineFunction &F);
     bool doInitialization(Module &M);
     bool doFinalization(Module &M);
@@ -136,20 +126,6 @@
   }
 }
 
-/// printMachineInstruction -- Print out a single Alpha MI to
-/// the current output stream.
-///
-void AlphaAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
-  ++EmittedInsts;
-  if (printInstruction(MI))
-    return; // Printer was automatically generated
-
-  assert(0 && "Unhandled instruction in asm writer!");
-  abort();
-  return;
-}
-
-
 /// runOnMachineFunction - This uses the printMachineInstruction()
 /// method to print assembly for each instruction.
 ///
@@ -177,7 +153,7 @@
      break;
   case Function::WeakLinkage:
   case Function::LinkOnceLinkage:
-    O << "\t.weak " << CurrentFnName << "\n";
+    O << TAI->getWeakRefDirective() << CurrentFnName << "\n";
     break;
   }
 
@@ -188,16 +164,21 @@
   // Print out code for the function.
   for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
        I != E; ++I) {
-    printBasicBlockLabel(I, true);
-    O << '\n';
+    if (I != MF.begin()) {
+      printBasicBlockLabel(I, true);
+      O << '\n';
+    }
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
       // Print the assembly for the instruction.
+      ++EmittedInsts;
       O << "\t";
-      printMachineInstruction(II);
+      if (!printInstruction(II)) {
+        assert(0 && "Unhandled instruction in asm writer!");
+        abort();
+      }
     }
   }
-  ++LabelNumber;
 
   O << "\t.end " << CurrentFnName << "\n";
 


Index: llvm/lib/Target/Alpha/AlphaLLRP.cpp
diff -u llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.5 llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.6
--- llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.5	Wed Dec  6 11:46:32 2006
+++ llvm/lib/Target/Alpha/AlphaLLRP.cpp	Thu Dec  7 17:55:55 2006
@@ -117,6 +117,9 @@
             case Alpha::ALTENT:
             case Alpha::MEMLABEL:
             case Alpha::PCLABEL:
+            case Alpha::IDEF_I:
+            case Alpha::IDEF_F32:
+            case Alpha::IDEF_F64:
               --count;
               break;
             case Alpha::BR:


Index: llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
diff -u llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp:1.4 llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp:1.5
--- llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp:1.4	Fri Oct  6 17:52:33 2006
+++ llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp	Thu Dec  7 17:55:55 2006
@@ -20,4 +20,5 @@
   PrivateGlobalPrefix = "$";
   JumpTableDirective = ".gprel32";
   JumpTableDataSection = "\t.section .rodata\n";
+  WeakRefDirective = "\t.weak\t";
 }






More information about the llvm-commits mailing list