mirror of
https://github.com/jeremysrand/llvm-65816.git
synced 2024-09-26 04:58:18 +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,
|
||||
raw_ostream &O) {
|
||||
// WDC_TODO - print the operand here...
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - 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");
|
||||
WDC_LOG("WDC_TODO - 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");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -27,19 +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");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void WDC65816FrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
}
|
||||
|
||||
|
||||
void WDC65816FrameLowering::emitEpilogue(MachineFunction &MF,
|
||||
MachineBasicBlock &MBB) const {
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,7 +70,7 @@ namespace {
|
||||
|
||||
SDNode* WDC65816DAGToDAGISel::getGlobalBaseReg() {
|
||||
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,
|
||||
getTargetLowering()->getPointerTy()).getNode();
|
||||
}
|
||||
@ -79,22 +79,19 @@ SDNode* WDC65816DAGToDAGISel::getGlobalBaseReg() {
|
||||
|
||||
|
||||
bool WDC65816DAGToDAGISel::SelectAbs(SDValue N, SDValue &R1) {
|
||||
// WDC_TODO - Write something here
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool WDC65816DAGToDAGISel::SelectAbsLong(SDValue N, SDValue &R1) {
|
||||
// WDC_TODO - Write something here
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool WDC65816DAGToDAGISel::SelectDirectPage(SDValue N, SDValue &R1) {
|
||||
// WDC_TODO - Write something here
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -170,7 +167,7 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
|
||||
#endif
|
||||
|
||||
SDNode *WDC65816DAGToDAGISel::Select(SDNode *N) {
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
return NULL;
|
||||
#if 0 // WDC_TODO - we will definitely need something here
|
||||
SDLoc dl(N);
|
||||
|
@ -151,6 +151,30 @@ static bool CC_WDC6581664_Half(unsigned &ValNo, MVT &ValVT,
|
||||
|
||||
#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?
|
||||
// The calling conventions in WDC65816CallingConv.td are described in terms of the
|
||||
// callee's register window. This function translates registers to the
|
||||
@ -164,16 +188,6 @@ static unsigned toCallerWindow(unsigned Reg) {
|
||||
#endif
|
||||
|
||||
#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
|
||||
WDC65816TargetLowering::LowerReturn_32(SDValue Chain,
|
||||
|
@ -57,6 +57,21 @@ namespace llvm {
|
||||
public:
|
||||
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?
|
||||
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
||||
|
||||
@ -84,14 +99,6 @@ namespace llvm {
|
||||
|
||||
/// getSetCCResultType - Return the ISD::SETCC ValueType
|
||||
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,
|
||||
CallingConv::ID CallConv,
|
||||
bool isVarArg,
|
||||
@ -113,12 +120,6 @@ namespace llvm {
|
||||
SDValue LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
|
||||
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,
|
||||
CallingConv::ID CallConv, bool IsVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
|
@ -85,8 +85,7 @@ void
|
||||
WDC65816RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
int SPAdj, unsigned FIOperandNum,
|
||||
RegScavenger *RS) const {
|
||||
// WDC_TODO - Write something here...
|
||||
WDC_LOG("Unimplemented method called");
|
||||
WDC_LOG("WDC_TODO - Unimplemented method called");
|
||||
}
|
||||
|
||||
#if 0 // TODO - How much of this stuff do I need?
|
||||
|
Loading…
Reference in New Issue
Block a user