diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-02-04 23:27:42 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-02-04 23:27:42 +0000 |
| commit | 465c0253c3228cad7c078b11fb1ed2b61f8076f3 (patch) | |
| tree | 3c01ed102bfca7642b9de255fdd29250443438d3 /llvm/lib/CodeGen/AsmPrinter.cpp | |
| parent | 4087017e4f27b9d3af0bb720bdbd560eff43c85c (diff) | |
| download | bcm5719-llvm-465c0253c3228cad7c078b11fb1ed2b61f8076f3.tar.gz bcm5719-llvm-465c0253c3228cad7c078b11fb1ed2b61f8076f3.zip | |
Fixing silly "not-implemented" bug in AsmPrinter. This fixes PR1169.
llvm-svn: 33888
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index ae082a63a29..37fb51f1c56 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -608,7 +608,8 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) { } } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) { const TargetData *TD = TM.getTargetData(); - switch(CE->getOpcode()) { + unsigned Opcode = CE->getOpcode(); + switch (Opcode) { case Instruction::GetElementPtr: { // generate a symbolic expression for the byte address const Constant *ptrVal = CE->getOperand(0); @@ -666,9 +667,10 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) { break; } case Instruction::Add: + case Instruction::Sub: O << "("; EmitConstantValueOnly(CE->getOperand(0)); - O << ") + ("; + O << (Opcode==Instruction::Add ? ") + (" : ") - ("); EmitConstantValueOnly(CE->getOperand(1)); O << ")"; break; |

