[llvm-commits] [llvm] r70762 - in /llvm/trunk/lib/Target/MSP430: MSP430AsmPrinter.cpp MSP430TargetAsmInfo.cpp MSP430TargetAsmInfo.h

Anton Korobeynikov asl at math.spbu.ru
Sun May 3 06:17:31 PDT 2009


Author: asl
Date: Sun May  3 08:17:31 2009
New Revision: 70762

URL: http://llvm.org/viewvc/llvm-project?rev=70762&view=rev
Log:
Some eye-candy

Modified:
    llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp
    llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp
    llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.h

Modified: llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp?rev=70762&r1=70761&r2=70762&view=diff

==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp Sun May  3 08:17:31 2009
@@ -125,6 +125,7 @@
 
 bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   SetupMachineFunction(MF);
+  O << "\n\n";
 
   // Print the 'header' of function
   emitFunctionHeader(MF);
@@ -133,20 +134,18 @@
   for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
        I != E; ++I) {
     // Print a label for the basic block.
-    if (I != MF.begin()) {
-      printBasicBlockLabel(I, true , true);
+    if (!VerboseAsm && (I->pred_empty() || I->isOnlyReachableByFallthrough())) {
+      // This is an entry block or a block that's only reachable via a
+      // fallthrough edge. In non-VerboseAsm mode, don't print the label.
+    } else {
+      printBasicBlockLabel(I, true, true, VerboseAsm);
       O << '\n';
     }
 
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
-         II != E; ++II) {
+         II != E; ++II)
       // Print the assembly for the instruction.
-      O << "\t";
       printMachineInstruction(II);
-    }
-
-    // Each Basic Block is separated by a newline
-    O << '\n';
   }
 
   if (TAI->hasDotTypeDotSizeDirective())

Modified: llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp?rev=70762&r1=70761&r2=70762&view=diff

==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp Sun May  3 08:17:31 2009
@@ -17,5 +17,6 @@
 using namespace llvm;
 
 MSP430TargetAsmInfo::MSP430TargetAsmInfo(const MSP430TargetMachine &TM)
-  : TargetAsmInfo(TM) {
+  : ELFTargetAsmInfo(TM) {
+  AlignmentIsInBytes = false;
 }

Modified: llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.h?rev=70762&r1=70761&r2=70762&view=diff

==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.h Sun May  3 08:17:31 2009
@@ -15,13 +15,14 @@
 #define MSP430TARGETASMINFO_H
 
 #include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/Target/ELFTargetAsmInfo.h"
 
 namespace llvm {
 
   // Forward declaration.
   class MSP430TargetMachine;
 
-  struct MSP430TargetAsmInfo : public TargetAsmInfo {
+  struct MSP430TargetAsmInfo : public ELFTargetAsmInfo {
     explicit MSP430TargetAsmInfo(const MSP430TargetMachine &TM);
   };
 





More information about the llvm-commits mailing list