summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
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
commit95cc3e0e6626776d517766fa42dcbfbed63c59b0 (patch)
tree25710cb74d7343442bfe84b877c059bcd9acc30e /llvm/lib/CodeGen/AsmPrinter.cpp
parenta51c88ccd8eed9cf322a7d2912bd81921677edc1 (diff)
downloadbcm5719-llvm-95cc3e0e6626776d517766fa42dcbfbed63c59b0.tar.gz
bcm5719-llvm-95cc3e0e6626776d517766fa42dcbfbed63c59b0.zip
Support more insane CEP's in AsmPrinter (Yes, PyPy folks do really use them).
llvm-svn: 45172
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp25
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;
OpenPOWER on IntegriCloud