Add support for call instructions (0-ary only for now).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12629 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brian Gaeke 2004-04-02 20:53:33 +00:00
parent 254bacd79a
commit f7e44ef8d5
4 changed files with 28 additions and 4 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {