From feb8893d1757cc4f9400a5969df7f926606e246e Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Tue, 18 Dec 2007 20:53:41 +0000 Subject: [PATCH] Support more insane CEP's in AsmPrinter (Yes, PyPy folks do really use them). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45172 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index ce89337f36f..1b4a575d437 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/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; -- 2.34.1