Add getBitCastOrAddrSpaceCast

llvm-svn: 196637
This commit is contained in:
Matt Arsenault
2013-12-07 02:58:41 +00:00
parent 42a91ef2ac
commit 21f38f4539
2 changed files with 21 additions and 2 deletions

View File

@@ -1499,7 +1499,18 @@ Constant *ConstantExpr::getPointerCast(Constant *S, Type *Ty) {
return getBitCast(S, Ty);
}
Constant *ConstantExpr::getIntegerCast(Constant *C, Type *Ty,
Constant *ConstantExpr::getPointerBitCastOrAddrSpaceCast(Constant *S,
Type *Ty) {
assert(S->getType()->isPtrOrPtrVectorTy() && "Invalid cast");
assert(Ty->isPtrOrPtrVectorTy() && "Invalid cast");
if (S->getType()->getPointerAddressSpace() != Ty->getPointerAddressSpace())
return getAddrSpaceCast(S, Ty);
return getBitCast(S, Ty);
}
Constant *ConstantExpr::getIntegerCast(Constant *C, Type *Ty,
bool isSigned) {
assert(C->getType()->isIntOrIntVectorTy() &&
Ty->isIntOrIntVectorTy() && "Invalid cast");