[llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Nov 4 10:05:03 PST 2003
Changes in directory llvm/lib/Target/X86:
Printer.cpp updated: 1.70 -> 1.71
---
Log message:
Fix problems in previous changes. This fixes several regressions last night.
---
Diffs of the changes: (+6 -5)
Index: llvm/lib/Target/X86/Printer.cpp
diff -u llvm/lib/Target/X86/Printer.cpp:1.70 llvm/lib/Target/X86/Printer.cpp:1.71
--- llvm/lib/Target/X86/Printer.cpp:1.70 Mon Nov 3 14:19:49 2003
+++ llvm/lib/Target/X86/Printer.cpp Tue Nov 4 10:04:32 2003
@@ -164,7 +164,7 @@
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 @@
if (unsigned Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) {
O << "(";
emitConstantValueOnly(ptrVal);
- O << ") + " + Offset;
+ O << ") + " << Offset;
} else {
emitConstantValueOnly(ptrVal);
}
@@ -187,12 +187,13 @@
// 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);
More information about the llvm-commits
mailing list