mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 06:38:20 +00:00
Some eye-candy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70762 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -125,6 +125,7 @@ void MSP430AsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
|
|||||||
|
|
||||||
bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||||
SetupMachineFunction(MF);
|
SetupMachineFunction(MF);
|
||||||
|
O << "\n\n";
|
||||||
|
|
||||||
// Print the 'header' of function
|
// Print the 'header' of function
|
||||||
emitFunctionHeader(MF);
|
emitFunctionHeader(MF);
|
||||||
@ -133,22 +134,20 @@ bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
|
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (!VerboseAsm && (I->pred_empty() || I->isOnlyReachableByFallthrough())) {
|
||||||
printBasicBlockLabel(I, true , true);
|
// 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';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
||||||
II != E; ++II) {
|
II != E; ++II)
|
||||||
// Print the assembly for the instruction.
|
// Print the assembly for the instruction.
|
||||||
O << "\t";
|
|
||||||
printMachineInstruction(II);
|
printMachineInstruction(II);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each Basic Block is separated by a newline
|
|
||||||
O << '\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TAI->hasDotTypeDotSizeDirective())
|
if (TAI->hasDotTypeDotSizeDirective())
|
||||||
O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << '\n';
|
O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << '\n';
|
||||||
|
|
||||||
|
@ -17,5 +17,6 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
MSP430TargetAsmInfo::MSP430TargetAsmInfo(const MSP430TargetMachine &TM)
|
MSP430TargetAsmInfo::MSP430TargetAsmInfo(const MSP430TargetMachine &TM)
|
||||||
: TargetAsmInfo(TM) {
|
: ELFTargetAsmInfo(TM) {
|
||||||
|
AlignmentIsInBytes = false;
|
||||||
}
|
}
|
||||||
|
@ -15,13 +15,14 @@
|
|||||||
#define MSP430TARGETASMINFO_H
|
#define MSP430TARGETASMINFO_H
|
||||||
|
|
||||||
#include "llvm/Target/TargetAsmInfo.h"
|
#include "llvm/Target/TargetAsmInfo.h"
|
||||||
|
#include "llvm/Target/ELFTargetAsmInfo.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
// Forward declaration.
|
// Forward declaration.
|
||||||
class MSP430TargetMachine;
|
class MSP430TargetMachine;
|
||||||
|
|
||||||
struct MSP430TargetAsmInfo : public TargetAsmInfo {
|
struct MSP430TargetAsmInfo : public ELFTargetAsmInfo {
|
||||||
explicit MSP430TargetAsmInfo(const MSP430TargetMachine &TM);
|
explicit MSP430TargetAsmInfo(const MSP430TargetMachine &TM);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user