mirror of
https://github.com/jeremysrand/llvm-65816.git
synced 2024-06-07 19:29:33 +00:00
Add some logs to help trace what i happening when executing.
This commit is contained in:
parent
6bfb66385d
commit
b11140166b
|
@ -15,6 +15,7 @@ using namespace llvm;
|
||||||
Target llvm::TheWDC65816Target;
|
Target llvm::TheWDC65816Target;
|
||||||
|
|
||||||
extern "C" void LLVMInitializeWDC65816TargetInfo() {
|
extern "C" void LLVMInitializeWDC65816TargetInfo() {
|
||||||
|
WDC_LOG("Registering the target");
|
||||||
RegisterTarget<Triple::wdc65816, /*HasJIT=*/ false>
|
RegisterTarget<Triple::wdc65816, /*HasJIT=*/ false>
|
||||||
X(TheWDC65816Target, "wdc65816", "WDC65816");
|
X(TheWDC65816Target, "wdc65816", "WDC65816");
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,18 +87,21 @@ namespace {
|
||||||
void WDC65816AsmPrinter::printOperand(const MachineInstr *MI, int opNum,
|
void WDC65816AsmPrinter::printOperand(const MachineInstr *MI, int opNum,
|
||||||
raw_ostream &O) {
|
raw_ostream &O) {
|
||||||
// WDC_TODO - print the operand here...
|
// WDC_TODO - print the operand here...
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WDC65816AsmPrinter::printMemOperand(const MachineInstr *MI, int opNum,
|
void WDC65816AsmPrinter::printMemOperand(const MachineInstr *MI, int opNum,
|
||||||
raw_ostream &O, const char *Modifier) {
|
raw_ostream &O, const char *Modifier) {
|
||||||
// WDC_TODO - print the memory operand here...
|
// WDC_TODO - print the memory operand here...
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WDC65816AsmPrinter::printGetPCX(const MachineInstr *MI, unsigned opNum,
|
bool WDC65816AsmPrinter::printGetPCX(const MachineInstr *MI, unsigned opNum,
|
||||||
raw_ostream &O) {
|
raw_ostream &O) {
|
||||||
// WDC_TODO - print whatever this is here...
|
// WDC_TODO - print whatever this is here...
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,4 +362,5 @@ isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const {
|
||||||
// Force static initialization.
|
// Force static initialization.
|
||||||
extern "C" void LLVMInitializeWDC65816AsmPrinter() {
|
extern "C" void LLVMInitializeWDC65816AsmPrinter() {
|
||||||
RegisterAsmPrinter<WDC65816AsmPrinter> X(TheWDC65816Target);
|
RegisterAsmPrinter<WDC65816AsmPrinter> X(TheWDC65816Target);
|
||||||
|
WDC_LOG("Assembly printer registered");
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,16 +27,19 @@ using namespace llvm;
|
||||||
// hasFP - Whether or not there is a frame pointer.
|
// hasFP - Whether or not there is a frame pointer.
|
||||||
// WDC_TODO - for now we will say we always have a frame pointer.
|
// WDC_TODO - for now we will say we always have a frame pointer.
|
||||||
bool WDC65816FrameLowering::hasFP(const MachineFunction &MF) const {
|
bool WDC65816FrameLowering::hasFP(const MachineFunction &MF) const {
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WDC65816FrameLowering::emitPrologue(MachineFunction &MF) const {
|
void WDC65816FrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WDC65816FrameLowering::emitEpilogue(MachineFunction &MF,
|
void WDC65816FrameLowering::emitEpilogue(MachineFunction &MF,
|
||||||
MachineBasicBlock &MBB) const {
|
MachineBasicBlock &MBB) const {
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@ namespace {
|
||||||
|
|
||||||
SDNode* WDC65816DAGToDAGISel::getGlobalBaseReg() {
|
SDNode* WDC65816DAGToDAGISel::getGlobalBaseReg() {
|
||||||
unsigned GlobalBaseReg = TM.getInstrInfo()->getGlobalBaseReg(MF);
|
unsigned GlobalBaseReg = TM.getInstrInfo()->getGlobalBaseReg(MF);
|
||||||
|
WDC_LOG("This method is probably implemented wrong...");
|
||||||
return CurDAG->getRegister(GlobalBaseReg,
|
return CurDAG->getRegister(GlobalBaseReg,
|
||||||
getTargetLowering()->getPointerTy()).getNode();
|
getTargetLowering()->getPointerTy()).getNode();
|
||||||
}
|
}
|
||||||
|
@ -79,18 +80,21 @@ SDNode* WDC65816DAGToDAGISel::getGlobalBaseReg() {
|
||||||
|
|
||||||
bool WDC65816DAGToDAGISel::SelectAbs(SDValue N, SDValue &R1) {
|
bool WDC65816DAGToDAGISel::SelectAbs(SDValue N, SDValue &R1) {
|
||||||
// WDC_TODO - Write something here
|
// WDC_TODO - Write something here
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WDC65816DAGToDAGISel::SelectAbsLong(SDValue N, SDValue &R1) {
|
bool WDC65816DAGToDAGISel::SelectAbsLong(SDValue N, SDValue &R1) {
|
||||||
// WDC_TODO - Write something here
|
// WDC_TODO - Write something here
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool WDC65816DAGToDAGISel::SelectDirectPage(SDValue N, SDValue &R1) {
|
bool WDC65816DAGToDAGISel::SelectDirectPage(SDValue N, SDValue &R1) {
|
||||||
// WDC_TODO - Write something here
|
// WDC_TODO - Write something here
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +170,7 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SDNode *WDC65816DAGToDAGISel::Select(SDNode *N) {
|
SDNode *WDC65816DAGToDAGISel::Select(SDNode *N) {
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
return NULL;
|
return NULL;
|
||||||
#if 0 // WDC_TODO - we will definitely need something here
|
#if 0 // WDC_TODO - we will definitely need something here
|
||||||
SDLoc dl(N);
|
SDLoc dl(N);
|
||||||
|
@ -248,5 +253,6 @@ SparcDAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op,
|
||||||
/// WDC65816-specific DAG, ready for instruction scheduling.
|
/// WDC65816-specific DAG, ready for instruction scheduling.
|
||||||
///
|
///
|
||||||
FunctionPass *llvm::createWDC65816ISelDag(WDC65816TargetMachine &TM) {
|
FunctionPass *llvm::createWDC65816ISelDag(WDC65816TargetMachine &TM) {
|
||||||
|
WDC_LOG("ISel DAG created");
|
||||||
return new WDC65816DAGToDAGISel(TM);
|
return new WDC65816DAGToDAGISel(TM);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#ifndef WDC65816MACHINEFUNCTIONINFO_H
|
#ifndef WDC65816MACHINEFUNCTIONINFO_H
|
||||||
#define WDC65816MACHINEFUNCTIONINFO_H
|
#define WDC65816MACHINEFUNCTIONINFO_H
|
||||||
|
|
||||||
|
#include "WDC65816.h"
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
@ -37,20 +38,27 @@ namespace llvm {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WDC65816MachineFunctionInfo()
|
WDC65816MachineFunctionInfo()
|
||||||
{}
|
: GlobalBaseReg(0) {}
|
||||||
#if 0 // WDC_TODO - Disable these members for now
|
#if 0 // WDC_TODO - Disable these members for now
|
||||||
: GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0),
|
, VarArgsFrameOffset(0), SRetReturnReg(0),
|
||||||
IsLeafProc(false) {}
|
IsLeafProc(false) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
unsigned getGlobalBaseReg() const { return GlobalBaseReg; }
|
unsigned getGlobalBaseReg() const {
|
||||||
void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }
|
WDC_LOG("Returning %u", GlobalBaseReg);
|
||||||
|
return GlobalBaseReg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setGlobalBaseReg(unsigned Reg) {
|
||||||
|
WDC_LOG("Setting global base register to %u", Reg);
|
||||||
|
GlobalBaseReg = Reg;
|
||||||
|
}
|
||||||
|
|
||||||
explicit WDC65816MachineFunctionInfo(MachineFunction &MF)
|
explicit WDC65816MachineFunctionInfo(MachineFunction &MF)
|
||||||
{}
|
: GlobalBaseReg(0) {}
|
||||||
#if 0 // WDC_TODO - Disable these members for now
|
#if 0 // WDC_TODO - Disable these members for now
|
||||||
: GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0),
|
, VarArgsFrameOffset(0), SRetReturnReg(0),
|
||||||
IsLeafProc(false) {}
|
IsLeafProc(false) {}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ WDC65816RegisterInfo::getRTCallPreservedMask(CallingConv::ID CC) const {
|
||||||
|
|
||||||
BitVector WDC65816RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
BitVector WDC65816RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
||||||
BitVector Reserved(getNumRegs());
|
BitVector Reserved(getNumRegs());
|
||||||
// FIXME: G1 reserved for now for large imm generation by frame code.
|
|
||||||
Reserved.set(WDC::P);
|
Reserved.set(WDC::P);
|
||||||
Reserved.set(WDC::S);
|
Reserved.set(WDC::S);
|
||||||
Reserved.set(WDC::D);
|
Reserved.set(WDC::D);
|
||||||
|
@ -78,9 +77,7 @@ unsigned WDC65816RegisterInfo::getFrameRegister(const MachineFunction &MF) const
|
||||||
const TargetRegisterClass*
|
const TargetRegisterClass*
|
||||||
WDC65816RegisterInfo::getPointerRegClass(const MachineFunction &MF,
|
WDC65816RegisterInfo::getPointerRegClass(const MachineFunction &MF,
|
||||||
unsigned Kind) const {
|
unsigned Kind) const {
|
||||||
// WDC_TODO - this is not a pointer reg actually. This should end up being the
|
return &WDC::Int32RegsRegClass;
|
||||||
// 32-bit direct page registers which are not defined yet.
|
|
||||||
return &WDC::IndexRegsRegClass;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,6 +86,7 @@ WDC65816RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||||
int SPAdj, unsigned FIOperandNum,
|
int SPAdj, unsigned FIOperandNum,
|
||||||
RegScavenger *RS) const {
|
RegScavenger *RS) const {
|
||||||
// WDC_TODO - Write something here...
|
// WDC_TODO - Write something here...
|
||||||
|
WDC_LOG("Unimplemented method called");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // TODO - How much of this stuff do I need?
|
#if 0 // TODO - How much of this stuff do I need?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user