diff options
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 25 | 
1 files changed, 24 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index ce89337f36f..1b4a575d437 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -773,9 +773,32 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {      }      case Instruction::Add:      case Instruction::Sub: +    case Instruction::And: +    case Instruction::Or: +    case Instruction::Xor:        O << "(";        EmitConstantValueOnly(CE->getOperand(0)); -      O << (Opcode==Instruction::Add ? ") + (" : ") - ("); +      O << ")"; +      switch (Opcode) { +      case Instruction::Add: +       O << " + "; +       break; +      case Instruction::Sub: +       O << " - "; +       break; +      case Instruction::And: +       O << " & "; +       break; +      case Instruction::Or: +       O << " | "; +       break; +      case Instruction::Xor: +       O << " ^ "; +       break; +      default: +       break; +      } +      O << "(";        EmitConstantValueOnly(CE->getOperand(1));        O << ")";        break;  | 

