mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-31 09:25:42 +00:00
Add support for casting any pointer to any integer type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -54,13 +54,15 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
|
|||||||
if (Op->getType()->getPrimitiveID() == C->getType()->getPrimitiveID())
|
if (Op->getType()->getPrimitiveID() == C->getType()->getPrimitiveID())
|
||||||
return getConstantValue(Op);
|
return getConstantValue(Op);
|
||||||
|
|
||||||
// Handle cast of long to pointer or pointer to long...
|
// Handle a cast of pointer to any integral type...
|
||||||
if ((isa<PointerType>(Op->getType()) && (C->getType() == Type::LongTy ||
|
if (isa<PointerType>(Op->getType()) &&
|
||||||
C->getType() == Type::ULongTy))||
|
(C->getType() == Type::LongTy || C->getType() == Type::ULongTy))
|
||||||
(isa<PointerType>(C->getType()) && (Op->getType() == Type::LongTy ||
|
return getConstantValue(Op);
|
||||||
Op->getType() == Type::ULongTy))){
|
|
||||||
|
// Handle cast of long to pointer...
|
||||||
|
if (isa<PointerType>(C->getType()) && (Op->getType() == Type::LongTy ||
|
||||||
|
Op->getType() == Type::ULongTy))
|
||||||
return getConstantValue(Op);
|
return getConstantValue(Op);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user