Add support for select constant expressions to the CBE, fixing SIOD
authorChris Lattner <sabre@nondot.org>
Thu, 1 Apr 2004 05:28:26 +0000 (05:28 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 1 Apr 2004 05:28:26 +0000 (05:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12589 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index 54b8bd3c19c4b3fa3cfa07223b73f629a4a9b34c..807f8ab92f1b1ff4549cc948252a999fe15e6a2c 100644 (file)
@@ -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:
index 54b8bd3c19c4b3fa3cfa07223b73f629a4a9b34c..807f8ab92f1b1ff4549cc948252a999fe15e6a2c 100644 (file)
@@ -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: