mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
ADd support for select instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12316 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
46b787e986
commit
9f24a077bd
@ -140,6 +140,7 @@ namespace {
|
||||
void visitBinaryOperator(Instruction &I);
|
||||
|
||||
void visitCastInst (CastInst &I);
|
||||
void visitSelectInst(SelectInst &I);
|
||||
void visitCallInst (CallInst &I);
|
||||
void visitCallSite (CallSite CS);
|
||||
void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); }
|
||||
@ -1185,6 +1186,17 @@ void CWriter::visitCastInst(CastInst &I) {
|
||||
writeOperand(I.getOperand(0));
|
||||
}
|
||||
|
||||
void CWriter::visitSelectInst(SelectInst &I) {
|
||||
Out << "((";
|
||||
writeOperand(I.getCondition());
|
||||
Out << ") ? (";
|
||||
writeOperand(I.getTrueValue());
|
||||
Out << ") : (";
|
||||
writeOperand(I.getFalseValue());
|
||||
Out << "))";
|
||||
}
|
||||
|
||||
|
||||
void CWriter::lowerIntrinsics(Module &M) {
|
||||
for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
|
||||
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
|
||||
|
@ -140,6 +140,7 @@ namespace {
|
||||
void visitBinaryOperator(Instruction &I);
|
||||
|
||||
void visitCastInst (CastInst &I);
|
||||
void visitSelectInst(SelectInst &I);
|
||||
void visitCallInst (CallInst &I);
|
||||
void visitCallSite (CallSite CS);
|
||||
void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); }
|
||||
@ -1185,6 +1186,17 @@ void CWriter::visitCastInst(CastInst &I) {
|
||||
writeOperand(I.getOperand(0));
|
||||
}
|
||||
|
||||
void CWriter::visitSelectInst(SelectInst &I) {
|
||||
Out << "((";
|
||||
writeOperand(I.getCondition());
|
||||
Out << ") ? (";
|
||||
writeOperand(I.getTrueValue());
|
||||
Out << ") : (";
|
||||
writeOperand(I.getFalseValue());
|
||||
Out << "))";
|
||||
}
|
||||
|
||||
|
||||
void CWriter::lowerIntrinsics(Module &M) {
|
||||
for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
|
||||
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
|
||||
|
Loading…
Reference in New Issue
Block a user