mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-20 11:29:24 +00:00
Fix problems in previous changes. This fixes several regressions last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9694 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
700867bb69
commit
9053356dd1
@ -164,7 +164,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
|
|||||||
else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))
|
else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))
|
||||||
// This is a constant address for a global variable or function. Use the
|
// This is a constant address for a global variable or function. Use the
|
||||||
// name of the variable or function as the address value.
|
// 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)) {
|
else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
|
||||||
const TargetData &TD = TM.getTargetData();
|
const TargetData &TD = TM.getTargetData();
|
||||||
switch(CE->getOpcode()) {
|
switch(CE->getOpcode()) {
|
||||||
@ -175,7 +175,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
|
|||||||
if (unsigned Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) {
|
if (unsigned Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) {
|
||||||
O << "(";
|
O << "(";
|
||||||
emitConstantValueOnly(ptrVal);
|
emitConstantValueOnly(ptrVal);
|
||||||
O << ") + " + Offset;
|
O << ") + " << Offset;
|
||||||
} else {
|
} else {
|
||||||
emitConstantValueOnly(ptrVal);
|
emitConstantValueOnly(ptrVal);
|
||||||
}
|
}
|
||||||
@ -187,12 +187,13 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
|
|||||||
// complete check.
|
// complete check.
|
||||||
Constant *Op = CE->getOperand(0);
|
Constant *Op = CE->getOperand(0);
|
||||||
const Type *OpTy = Op->getType(), *Ty = CE->getType();
|
const Type *OpTy = Op->getType(), *Ty = CE->getType();
|
||||||
|
|
||||||
assert(((isa<PointerType>(OpTy)
|
assert(((isa<PointerType>(OpTy)
|
||||||
&& (Ty == Type::LongTy || Ty == Type::ULongTy))
|
&& (Ty == Type::LongTy || Ty == Type::ULongTy))
|
||||||
|| (isa<PointerType>(Ty)
|
|| (isa<PointerType>(Ty)
|
||||||
&& (OpTy == Type::LongTy || OpTy == Type::ULongTy)))
|
&& (OpTy == Type::LongTy || OpTy == Type::ULongTy))
|
||||||
|| (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy))
|
|| (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy))
|
||||||
&& (OpTy->isLosslesslyConvertibleTo(Ty))))
|
&& OpTy->isLosslesslyConvertibleTo(Ty))))
|
||||||
&& "FIXME: Don't yet support this kind of constant cast expr");
|
&& "FIXME: Don't yet support this kind of constant cast expr");
|
||||||
O << "(";
|
O << "(";
|
||||||
emitConstantValueOnly(Op);
|
emitConstantValueOnly(Op);
|
||||||
|
@ -164,7 +164,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
|
|||||||
else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))
|
else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))
|
||||||
// This is a constant address for a global variable or function. Use the
|
// This is a constant address for a global variable or function. Use the
|
||||||
// name of the variable or function as the address value.
|
// 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)) {
|
else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CV)) {
|
||||||
const TargetData &TD = TM.getTargetData();
|
const TargetData &TD = TM.getTargetData();
|
||||||
switch(CE->getOpcode()) {
|
switch(CE->getOpcode()) {
|
||||||
@ -175,7 +175,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
|
|||||||
if (unsigned Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) {
|
if (unsigned Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) {
|
||||||
O << "(";
|
O << "(";
|
||||||
emitConstantValueOnly(ptrVal);
|
emitConstantValueOnly(ptrVal);
|
||||||
O << ") + " + Offset;
|
O << ") + " << Offset;
|
||||||
} else {
|
} else {
|
||||||
emitConstantValueOnly(ptrVal);
|
emitConstantValueOnly(ptrVal);
|
||||||
}
|
}
|
||||||
@ -187,12 +187,13 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
|
|||||||
// complete check.
|
// complete check.
|
||||||
Constant *Op = CE->getOperand(0);
|
Constant *Op = CE->getOperand(0);
|
||||||
const Type *OpTy = Op->getType(), *Ty = CE->getType();
|
const Type *OpTy = Op->getType(), *Ty = CE->getType();
|
||||||
|
|
||||||
assert(((isa<PointerType>(OpTy)
|
assert(((isa<PointerType>(OpTy)
|
||||||
&& (Ty == Type::LongTy || Ty == Type::ULongTy))
|
&& (Ty == Type::LongTy || Ty == Type::ULongTy))
|
||||||
|| (isa<PointerType>(Ty)
|
|| (isa<PointerType>(Ty)
|
||||||
&& (OpTy == Type::LongTy || OpTy == Type::ULongTy)))
|
&& (OpTy == Type::LongTy || OpTy == Type::ULongTy))
|
||||||
|| (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy))
|
|| (((TD.getTypeSize(Ty) >= TD.getTypeSize(OpTy))
|
||||||
&& (OpTy->isLosslesslyConvertibleTo(Ty))))
|
&& OpTy->isLosslesslyConvertibleTo(Ty))))
|
||||||
&& "FIXME: Don't yet support this kind of constant cast expr");
|
&& "FIXME: Don't yet support this kind of constant cast expr");
|
||||||
O << "(";
|
O << "(";
|
||||||
emitConstantValueOnly(Op);
|
emitConstantValueOnly(Op);
|
||||||
|
Loading…
Reference in New Issue
Block a user