diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 54b8bd3c19c..807f8ab92f1 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -388,6 +388,15 @@ void CWriter::printConstant(Constant *CPV) { gep_type_end(CPV)); Out << "))"; return; + case Instruction::Select: + Out << "("; + printConstant(CE->getOperand(0)); + Out << "?"; + printConstant(CE->getOperand(1)); + Out << ":"; + printConstant(CE->getOperand(2)); + Out << ")"; + return; case Instruction::Add: case Instruction::Sub: case Instruction::Mul: diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 54b8bd3c19c..807f8ab92f1 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -388,6 +388,15 @@ void CWriter::printConstant(Constant *CPV) { gep_type_end(CPV)); Out << "))"; return; + case Instruction::Select: + Out << "("; + printConstant(CE->getOperand(0)); + Out << "?"; + printConstant(CE->getOperand(1)); + Out << ":"; + printConstant(CE->getOperand(2)); + Out << ")"; + return; case Instruction::Add: case Instruction::Sub: case Instruction::Mul: