Some eye-candy

llvm-svn: 70762
This commit is contained in:
Anton Korobeynikov 2009-05-03 13:17:31 +00:00
parent 48e21c57f1
commit 3c48ea7dbe
3 changed files with 11 additions and 10 deletions

View File

@ -125,6 +125,7 @@ void MSP430AsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
SetupMachineFunction(MF);
O << "\n\n";
// Print the 'header' of function
emitFunctionHeader(MF);
@ -133,20 +134,18 @@ bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
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())

View File

@ -17,5 +17,6 @@
using namespace llvm;
MSP430TargetAsmInfo::MSP430TargetAsmInfo(const MSP430TargetMachine &TM)
: TargetAsmInfo(TM) {
: ELFTargetAsmInfo(TM) {
AlignmentIsInBytes = false;
}

View File

@ -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);
};