diff --git a/lib/Target/Sparc/InstSelectSimple.cpp b/lib/Target/Sparc/InstSelectSimple.cpp index 890e55d4d3d..05a1920946d 100644 --- a/lib/Target/Sparc/InstSelectSimple.cpp +++ b/lib/Target/Sparc/InstSelectSimple.cpp @@ -58,7 +58,8 @@ namespace { } void visitBinaryOperator(BinaryOperator &I); - void visitReturnInst(ReturnInst &RI); + void visitCallInst(CallInst &I); + void visitReturnInst(ReturnInst &RI); void visitInstruction(Instruction &I) { std::cerr << "Unhandled instruction: " << I; @@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) { return true; } +void V8ISel::visitCallInst(CallInst &I) { + assert (I.getNumOperands () == 1 && "Can't handle call args yet"); + BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0)); + BuildMI (BB, V8::NOP, 0); // NOP in delay slot +} void V8ISel::visitReturnInst(ReturnInst &I) { if (I.getNumOperands () == 1) { diff --git a/lib/Target/Sparc/SparcV8ISelSimple.cpp b/lib/Target/Sparc/SparcV8ISelSimple.cpp index 890e55d4d3d..05a1920946d 100644 --- a/lib/Target/Sparc/SparcV8ISelSimple.cpp +++ b/lib/Target/Sparc/SparcV8ISelSimple.cpp @@ -58,7 +58,8 @@ namespace { } void visitBinaryOperator(BinaryOperator &I); - void visitReturnInst(ReturnInst &RI); + void visitCallInst(CallInst &I); + void visitReturnInst(ReturnInst &RI); void visitInstruction(Instruction &I) { std::cerr << "Unhandled instruction: " << I; @@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) { return true; } +void V8ISel::visitCallInst(CallInst &I) { + assert (I.getNumOperands () == 1 && "Can't handle call args yet"); + BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0)); + BuildMI (BB, V8::NOP, 0); // NOP in delay slot +} void V8ISel::visitReturnInst(ReturnInst &I) { if (I.getNumOperands () == 1) { diff --git a/lib/Target/SparcV8/InstSelectSimple.cpp b/lib/Target/SparcV8/InstSelectSimple.cpp index 890e55d4d3d..05a1920946d 100644 --- a/lib/Target/SparcV8/InstSelectSimple.cpp +++ b/lib/Target/SparcV8/InstSelectSimple.cpp @@ -58,7 +58,8 @@ namespace { } void visitBinaryOperator(BinaryOperator &I); - void visitReturnInst(ReturnInst &RI); + void visitCallInst(CallInst &I); + void visitReturnInst(ReturnInst &RI); void visitInstruction(Instruction &I) { std::cerr << "Unhandled instruction: " << I; @@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) { return true; } +void V8ISel::visitCallInst(CallInst &I) { + assert (I.getNumOperands () == 1 && "Can't handle call args yet"); + BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0)); + BuildMI (BB, V8::NOP, 0); // NOP in delay slot +} void V8ISel::visitReturnInst(ReturnInst &I) { if (I.getNumOperands () == 1) { diff --git a/lib/Target/SparcV8/SparcV8ISelSimple.cpp b/lib/Target/SparcV8/SparcV8ISelSimple.cpp index 890e55d4d3d..05a1920946d 100644 --- a/lib/Target/SparcV8/SparcV8ISelSimple.cpp +++ b/lib/Target/SparcV8/SparcV8ISelSimple.cpp @@ -58,7 +58,8 @@ namespace { } void visitBinaryOperator(BinaryOperator &I); - void visitReturnInst(ReturnInst &RI); + void visitCallInst(CallInst &I); + void visitReturnInst(ReturnInst &RI); void visitInstruction(Instruction &I) { std::cerr << "Unhandled instruction: " << I; @@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) { return true; } +void V8ISel::visitCallInst(CallInst &I) { + assert (I.getNumOperands () == 1 && "Can't handle call args yet"); + BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0)); + BuildMI (BB, V8::NOP, 0); // NOP in delay slot +} void V8ISel::visitReturnInst(ReturnInst &I) { if (I.getNumOperands () == 1) {