1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

ADd support for select instructions

llvm-svn: 12316
This commit is contained in:
Chris Lattner 2004-03-12 05:52:14 +00:00
parent c90b157c66
commit e536e15ce1

View File

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