mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
switch blackfin to the default runOnMachineFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94729 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,14 +30,11 @@
|
|||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||||
#include "llvm/Target/TargetRegistry.h"
|
#include "llvm/Target/TargetRegistry.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
|
||||||
#include "llvm/ADT/SmallString.h"
|
#include "llvm/ADT/SmallString.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/FormattedStream.h"
|
#include "llvm/Support/FormattedStream.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
STATISTIC(EmittedInsts, "Number of machine instrs printed");
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class BlackfinAsmPrinter : public AsmPrinter {
|
class BlackfinAsmPrinter : public AsmPrinter {
|
||||||
public:
|
public:
|
||||||
@@ -54,7 +51,7 @@ namespace {
|
|||||||
void printInstruction(const MachineInstr *MI); // autogenerated.
|
void printInstruction(const MachineInstr *MI); // autogenerated.
|
||||||
static const char *getRegisterName(unsigned RegNo);
|
static const char *getRegisterName(unsigned RegNo);
|
||||||
|
|
||||||
bool runOnMachineFunction(MachineFunction &F);
|
void EmitInstruction(const MachineInstr *MI) { printInstruction(MI); }
|
||||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
unsigned AsmVariant, const char *ExtraCode);
|
unsigned AsmVariant, const char *ExtraCode);
|
||||||
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
|
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
@@ -68,45 +65,6 @@ extern "C" void LLVMInitializeBlackfinAsmPrinter() {
|
|||||||
RegisterAsmPrinter<BlackfinAsmPrinter> X(TheBlackfinTarget);
|
RegisterAsmPrinter<BlackfinAsmPrinter> X(TheBlackfinTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the printInstruction()
|
|
||||||
/// method to print assembly for each instruction.
|
|
||||||
///
|
|
||||||
bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|
||||||
SetupMachineFunction(MF);
|
|
||||||
|
|
||||||
EmitFunctionHeader();
|
|
||||||
|
|
||||||
// Print out code for the function.
|
|
||||||
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
|
|
||||||
I != E; ++I) {
|
|
||||||
// Print a label for the basic block.
|
|
||||||
EmitBasicBlockStart(I);
|
|
||||||
|
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
|
||||||
II != E; ++II) {
|
|
||||||
// Print the assembly for the instruction.
|
|
||||||
processDebugLoc(II, true);
|
|
||||||
|
|
||||||
printInstruction(II);
|
|
||||||
if (VerboseAsm)
|
|
||||||
EmitComments(*II);
|
|
||||||
O << '\n';
|
|
||||||
|
|
||||||
processDebugLoc(II, false);
|
|
||||||
++EmittedInsts;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EmitJumpTableInfo();
|
|
||||||
|
|
||||||
O << "\t.size " << *CurrentFnSym << ", .-" << *CurrentFnSym << "\n";
|
|
||||||
|
|
||||||
if (DW)
|
|
||||||
DW->EndFunction(&MF);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
||||||
const MachineOperand &MO = MI->getOperand (opNum);
|
const MachineOperand &MO = MI->getOperand (opNum);
|
||||||
switch (MO.getType()) {
|
switch (MO.getType()) {
|
||||||
|
Reference in New Issue
Block a user