mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
Add CreateZExtOrBitCast and CreateSExtOrBitCast to TargetFolder
for consistency with ConstantFolder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91203cf87b
commit
e18700a09a
@ -179,6 +179,16 @@ public:
|
||||
Constant *CreatePtrToInt(Constant *C, const Type *DestTy) const {
|
||||
return CreateCast(Instruction::PtrToInt, C, DestTy);
|
||||
}
|
||||
Constant *CreateZExtOrBitCast(Constant *C, const Type *DestTy) const {
|
||||
if (C->getType() == DestTy)
|
||||
return C; // avoid calling Fold
|
||||
return Fold(ConstantExpr::getZExtOrBitCast(C, DestTy));
|
||||
}
|
||||
Constant *CreateSExtOrBitCast(Constant *C, const Type *DestTy) const {
|
||||
if (C->getType() == DestTy)
|
||||
return C; // avoid calling Fold
|
||||
return Fold(ConstantExpr::getSExtOrBitCast(C, DestTy));
|
||||
}
|
||||
Constant *CreateTruncOrBitCast(Constant *C, const Type *DestTy) const {
|
||||
if (C->getType() == DestTy)
|
||||
return C; // avoid calling Fold
|
||||
|
Loading…
Reference in New Issue
Block a user