summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-02-04 23:27:42 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-02-04 23:27:42 +0000
commit465c0253c3228cad7c078b11fb1ed2b61f8076f3 (patch)
tree3c01ed102bfca7642b9de255fdd29250443438d3 /llvm/lib/CodeGen/AsmPrinter.cpp
parent4087017e4f27b9d3af0bb720bdbd560eff43c85c (diff)
downloadbcm5719-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.cpp6
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;
OpenPOWER on IntegriCloud