Fix PR149 - support constant shift expressions.
authorBrian Gaeke <gaeke@uiuc.edu>
Sat, 22 Nov 2003 05:02:56 +0000 (05:02 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Sat, 22 Nov 2003 05:02:56 +0000 (05:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10167 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 98fc05bf235090c2b9a84e5e22b4651baa2f39fe..fdd9b4bc0d63ffa68154c20417b5fbaa4ed8adfe 100644 (file)
@@ -396,6 +396,8 @@ void CWriter::printConstant(Constant *CPV) {
     case Instruction::SetLE:
     case Instruction::SetGT:
     case Instruction::SetGE:
+    case Instruction::Shl:
+    case Instruction::Shr:
       Out << "(";
       printConstant(CE->getOperand(0));
       switch (CE->getOpcode()) {
@@ -410,6 +412,8 @@ void CWriter::printConstant(Constant *CPV) {
       case Instruction::SetLE: Out << " <= "; break;
       case Instruction::SetGT: Out << " > "; break;
       case Instruction::SetGE: Out << " >= "; break;
+      case Instruction::Shl: Out << " << "; break;
+      case Instruction::Shr: Out << " >> "; break;
       default: assert(0 && "Illegal opcode here!");
       }
       printConstant(CE->getOperand(1));
index 98fc05bf235090c2b9a84e5e22b4651baa2f39fe..fdd9b4bc0d63ffa68154c20417b5fbaa4ed8adfe 100644 (file)
@@ -396,6 +396,8 @@ void CWriter::printConstant(Constant *CPV) {
     case Instruction::SetLE:
     case Instruction::SetGT:
     case Instruction::SetGE:
+    case Instruction::Shl:
+    case Instruction::Shr:
       Out << "(";
       printConstant(CE->getOperand(0));
       switch (CE->getOpcode()) {
@@ -410,6 +412,8 @@ void CWriter::printConstant(Constant *CPV) {
       case Instruction::SetLE: Out << " <= "; break;
       case Instruction::SetGT: Out << " > "; break;
       case Instruction::SetGE: Out << " >= "; break;
+      case Instruction::Shl: Out << " << "; break;
+      case Instruction::Shr: Out << " >> "; break;
       default: assert(0 && "Illegal opcode here!");
       }
       printConstant(CE->getOperand(1));