diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-12-18 20:53:41 +0000 | 
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-12-18 20:53:41 +0000 | 
| commit | 95cc3e0e6626776d517766fa42dcbfbed63c59b0 (patch) | |
| tree | 25710cb74d7343442bfe84b877c059bcd9acc30e | |
| parent | a51c88ccd8eed9cf322a7d2912bd81921677edc1 (diff) | |
| download | bcm5719-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
| -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;  | 

