[llvm-commits] [llvm] r45172 - /llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Tue Dec 18 12:53:41 PST 2007
Author: asl
Date: Tue Dec 18 14:53:41 2007
New Revision: 45172
URL: http://llvm.org/viewvc/llvm-project?rev=45172&view=rev
Log:
Support more insane CEP's in AsmPrinter (Yes, PyPy folks do really use them).
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=45172&r1=45171&r2=45172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Tue Dec 18 14:53:41 2007
@@ -773,9 +773,32 @@
}
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;
More information about the llvm-commits
mailing list