mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
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:
parent
254bacd79a
commit
f7e44ef8d5
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user