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