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

llvm-svn: 12629
This commit is contained in:
Brian Gaeke 2004-04-02 20:53:33 +00:00
parent 6f29c89597
commit 2fd46b6e43
1 changed files with 7 additions and 1 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) {