aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-12-18 20:53:41 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-12-18 20:53:41 +0000
commitfeb8893d1757cc4f9400a5969df7f926606e246e (patch)
tree2a9af1bde485aa05555df94a21d634a7c2113e7e /lib
parent1d87cb1c1226760b86a6ee923c97a439644f1a1d (diff)
downloadexternal_llvm-feb8893d1757cc4f9400a5969df7f926606e246e.zip
external_llvm-feb8893d1757cc4f9400a5969df7f926606e246e.tar.gz
external_llvm-feb8893d1757cc4f9400a5969df7f926606e246e.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index ce89337..1b4a575 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;