mirror of
https://github.com/jeremysrand/llvm-65816.git
synced 2024-06-25 04:29:34 +00:00
Add placeholder implementations of a couple more methods. At this point, I can "compile":
int theAnswer(void) { return 42; } It compiles in the sense that clang executes to the end without crashing but the .s file it produces is useless. But another small step forward.
This commit is contained in:
parent
9d6408d419
commit
4862a6612b
|
@ -86,22 +86,19 @@ 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_LOG("WDC_TODO - Unimplemented method called");
|
||||||
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_LOG("WDC_TODO - Unimplemented method called");
|
||||||
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_LOG("WDC_TODO - Unimplemented method called");
|
||||||
WDC_LOG("Unimplemented method called");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,19 +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");
|
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WDC65816FrameLowering::emitPrologue(MachineFunction &MF) const {
|
void WDC65816FrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||||
WDC_LOG("Unimplemented method called");
|
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WDC65816FrameLowering::emitEpilogue(MachineFunction &MF,
|
void WDC65816FrameLowering::emitEpilogue(MachineFunction &MF,
|
||||||
MachineBasicBlock &MBB) const {
|
MachineBasicBlock &MBB) const {
|
||||||
WDC_LOG("Unimplemented method called");
|
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -70,7 +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...");
|
WDC_LOG("WDC_TODO - This method is probably implemented wrong...");
|
||||||
return CurDAG->getRegister(GlobalBaseReg,
|
return CurDAG->getRegister(GlobalBaseReg,
|
||||||
getTargetLowering()->getPointerTy()).getNode();
|
getTargetLowering()->getPointerTy()).getNode();
|
||||||
}
|
}
|
||||||
|
@ -79,22 +79,19 @@ SDNode* WDC65816DAGToDAGISel::getGlobalBaseReg() {
|
||||||
|
|
||||||
|
|
||||||
bool WDC65816DAGToDAGISel::SelectAbs(SDValue N, SDValue &R1) {
|
bool WDC65816DAGToDAGISel::SelectAbs(SDValue N, SDValue &R1) {
|
||||||
// WDC_TODO - Write something here
|
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||||
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_LOG("WDC_TODO - Unimplemented method called");
|
||||||
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_LOG("WDC_TODO - Unimplemented method called");
|
||||||
WDC_LOG("Unimplemented method called");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +167,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");
|
WDC_LOG("WDC_TODO - 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);
|
||||||
|
|
|
@ -151,6 +151,30 @@ static bool CC_WDC6581664_Half(unsigned &ValNo, MVT &ValVT,
|
||||||
|
|
||||||
#include "WDC65816GenCallingConv.inc"
|
#include "WDC65816GenCallingConv.inc"
|
||||||
|
|
||||||
|
|
||||||
|
SDValue WDC65816TargetLowering::LowerFormalArguments(SDValue Chain,
|
||||||
|
CallingConv::ID CallConv,
|
||||||
|
bool IsVarArg,
|
||||||
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||||
|
SDLoc DL,
|
||||||
|
SelectionDAG &DAG,
|
||||||
|
SmallVectorImpl<SDValue> &InVals) const {
|
||||||
|
WDC_LOG("WDC_TODO - Not implemented yet!");
|
||||||
|
return Chain;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SDValue
|
||||||
|
WDC65816TargetLowering::LowerReturn(SDValue Chain,
|
||||||
|
CallingConv::ID CallConv, bool IsVarArg,
|
||||||
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||||
|
const SmallVectorImpl<SDValue> &OutVals,
|
||||||
|
SDLoc DL, SelectionDAG &DAG) const {
|
||||||
|
WDC_LOG("WDC_TODO - Not implemented yet!");
|
||||||
|
return Chain;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0 // WDC_TODO - Get rid of this?
|
#if 0 // WDC_TODO - Get rid of this?
|
||||||
// The calling conventions in WDC65816CallingConv.td are described in terms of the
|
// The calling conventions in WDC65816CallingConv.td are described in terms of the
|
||||||
// callee's register window. This function translates registers to the
|
// callee's register window. This function translates registers to the
|
||||||
|
@ -164,16 +188,6 @@ static unsigned toCallerWindow(unsigned Reg) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0 // WDC_TODO - Disable more stuff
|
#if 0 // WDC_TODO - Disable more stuff
|
||||||
SDValue
|
|
||||||
WDC65816TargetLowering::LowerReturn(SDValue Chain,
|
|
||||||
CallingConv::ID CallConv, bool IsVarArg,
|
|
||||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
|
||||||
const SmallVectorImpl<SDValue> &OutVals,
|
|
||||||
SDLoc DL, SelectionDAG &DAG) const {
|
|
||||||
if (Subtarget->is64Bit())
|
|
||||||
return LowerReturn_64(Chain, CallConv, IsVarArg, Outs, OutVals, DL, DAG);
|
|
||||||
return LowerReturn_32(Chain, CallConv, IsVarArg, Outs, OutVals, DL, DAG);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDValue
|
SDValue
|
||||||
WDC65816TargetLowering::LowerReturn_32(SDValue Chain,
|
WDC65816TargetLowering::LowerReturn_32(SDValue Chain,
|
||||||
|
|
|
@ -57,6 +57,21 @@ namespace llvm {
|
||||||
public:
|
public:
|
||||||
WDC65816TargetLowering(TargetMachine &TM);
|
WDC65816TargetLowering(TargetMachine &TM);
|
||||||
|
|
||||||
|
virtual SDValue
|
||||||
|
LowerFormalArguments(SDValue Chain,
|
||||||
|
CallingConv::ID CallConv,
|
||||||
|
bool isVarArg,
|
||||||
|
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||||
|
SDLoc dl, SelectionDAG &DAG,
|
||||||
|
SmallVectorImpl<SDValue> &InVals) const;
|
||||||
|
|
||||||
|
virtual SDValue
|
||||||
|
LowerReturn(SDValue Chain,
|
||||||
|
CallingConv::ID CallConv, bool isVarArg,
|
||||||
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||||
|
const SmallVectorImpl<SDValue> &OutVals,
|
||||||
|
SDLoc dl, SelectionDAG &DAG) const;
|
||||||
|
|
||||||
#if 0 // WDC_TODO - Do I need any of this?
|
#if 0 // WDC_TODO - Do I need any of this?
|
||||||
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
||||||
|
|
||||||
|
@ -84,14 +99,6 @@ namespace llvm {
|
||||||
|
|
||||||
/// getSetCCResultType - Return the ISD::SETCC ValueType
|
/// getSetCCResultType - Return the ISD::SETCC ValueType
|
||||||
virtual EVT getSetCCResultType(LLVMContext &Context, EVT VT) const;
|
virtual EVT getSetCCResultType(LLVMContext &Context, EVT VT) const;
|
||||||
|
|
||||||
virtual SDValue
|
|
||||||
LowerFormalArguments(SDValue Chain,
|
|
||||||
CallingConv::ID CallConv,
|
|
||||||
bool isVarArg,
|
|
||||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
|
||||||
SDLoc dl, SelectionDAG &DAG,
|
|
||||||
SmallVectorImpl<SDValue> &InVals) const;
|
|
||||||
SDValue LowerFormalArguments_32(SDValue Chain,
|
SDValue LowerFormalArguments_32(SDValue Chain,
|
||||||
CallingConv::ID CallConv,
|
CallingConv::ID CallConv,
|
||||||
bool isVarArg,
|
bool isVarArg,
|
||||||
|
@ -113,12 +120,6 @@ namespace llvm {
|
||||||
SDValue LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
|
SDValue LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
|
||||||
SmallVectorImpl<SDValue> &InVals) const;
|
SmallVectorImpl<SDValue> &InVals) const;
|
||||||
|
|
||||||
virtual SDValue
|
|
||||||
LowerReturn(SDValue Chain,
|
|
||||||
CallingConv::ID CallConv, bool isVarArg,
|
|
||||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
|
||||||
const SmallVectorImpl<SDValue> &OutVals,
|
|
||||||
SDLoc dl, SelectionDAG &DAG) const;
|
|
||||||
SDValue LowerReturn_32(SDValue Chain,
|
SDValue LowerReturn_32(SDValue Chain,
|
||||||
CallingConv::ID CallConv, bool IsVarArg,
|
CallingConv::ID CallConv, bool IsVarArg,
|
||||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||||
|
|
|
@ -85,8 +85,7 @@ void
|
||||||
WDC65816RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
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_LOG("WDC_TODO - Unimplemented method called");
|
||||||
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