diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-11-04 16:04:32 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-11-04 16:04:32 +0000 |
| commit | 47dfa641c378be6d929e934c5cd4ffadc08be80c (patch) | |
| tree | 96d56bd3ab0d165734f889dadcd4ce2d93df873a /llvm/lib/Target/X86/Printer.cpp | |
| parent | 81587e798a9ca0c50e5789b64c1e2abbddcaa5ad (diff) | |
| download | bcm5719-llvm-47dfa641c378be6d929e934c5cd4ffadc08be80c.tar.gz bcm5719-llvm-47dfa641c378be6d929e934c5cd4ffadc08be80c.zip | |
Fix problems in previous changes. This fixes several regressions last night.
llvm-svn: 9694
Diffstat (limited to 'llvm/lib/Target/X86/Printer.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/Printer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/Printer.cpp b/llvm/lib/Target/X86/Printer.cpp index cfeac4c0f7b..3d073f77c65 100644 --- a/llvm/lib/Target/X86/Printer.cpp +++ b/llvm/lib/Target/X86/Printer.cpp @@ -164,7 +164,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) { else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV)) // This is a constant address for a global variable or function. Use the // name of the variable or function as the address value. - O << Mang->getValueName(CPR->getValue()) << "\n"; + O << Mang->getValueName(CPR->getValue()); else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) { const TargetData &TD = TM.getTargetData(); switch(CE->getOpcode()) { @@ -175,7 +175,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) { if (unsigned Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) { O << "("; emitConstantValueOnly(ptrVal); - O << ") + " + Offset; + O << ") + " << Offset; } else { emitConstantValueOnly(ptrVal); } @@ -187,12 +187,13 @@ void Printer::emitConstantValueOnly(const Constant *CV) { // complete check. Constant *Op = CE->getOperand(0); const Type *OpTy = Op->getType(), *Ty = CE->getType(); + assert(((isa<PointerType>(OpTy) && (Ty == Type::LongTy || Ty == Type::ULongTy)) || (isa<PointerType>(Ty) - && (OpTy == Type::LongTy || OpTy == Type::ULongTy))) - || (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy)) - && (OpTy->isLosslesslyConvertibleTo(Ty)))) + && (OpTy == Type::LongTy || OpTy == Type::ULongTy)) + || (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy)) + && OpTy->isLosslesslyConvertibleTo(Ty)))) && "FIXME: Don't yet support this kind of constant cast expr"); O << "("; emitConstantValueOnly(Op); |

