mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-08 20:30:50 +00:00
Corrected assert messages for CreateZExtOrTrunc/CreateSExtOrTrunc.
llvm-svn: 172958
This commit is contained in:
parent
613607db03
commit
5716eb1faa
@ -1028,7 +1028,8 @@ public:
|
|||||||
/// DestTy. Return the value untouched if the type of V is already DestTy.
|
/// DestTy. Return the value untouched if the type of V is already DestTy.
|
||||||
Value *CreateZExtOrTrunc(Value *V, IntegerType *DestTy,
|
Value *CreateZExtOrTrunc(Value *V, IntegerType *DestTy,
|
||||||
const Twine &Name = "") {
|
const Twine &Name = "") {
|
||||||
assert(isa<IntegerType>(V->getType()) && "Can only zero extend integers!");
|
assert(isa<IntegerType>(V->getType()) &&
|
||||||
|
"Can only zero extend/truncate integers!");
|
||||||
IntegerType *IntTy = cast<IntegerType>(V->getType());
|
IntegerType *IntTy = cast<IntegerType>(V->getType());
|
||||||
if (IntTy->getBitWidth() < DestTy->getBitWidth())
|
if (IntTy->getBitWidth() < DestTy->getBitWidth())
|
||||||
return CreateZExt(V, DestTy, Name);
|
return CreateZExt(V, DestTy, Name);
|
||||||
@ -1040,7 +1041,8 @@ public:
|
|||||||
/// DestTy. Return the value untouched if the type of V is already DestTy.
|
/// DestTy. Return the value untouched if the type of V is already DestTy.
|
||||||
Value *CreateSExtOrTrunc(Value *V, IntegerType *DestTy,
|
Value *CreateSExtOrTrunc(Value *V, IntegerType *DestTy,
|
||||||
const Twine &Name = "") {
|
const Twine &Name = "") {
|
||||||
assert(isa<IntegerType>(V->getType()) && "Can only sign extend integers!");
|
assert(isa<IntegerType>(V->getType()) &&
|
||||||
|
"Can only sign extend/truncate integers!");
|
||||||
IntegerType *IntTy = cast<IntegerType>(V->getType());
|
IntegerType *IntTy = cast<IntegerType>(V->getType());
|
||||||
if (IntTy->getBitWidth() < DestTy->getBitWidth())
|
if (IntTy->getBitWidth() < DestTy->getBitWidth())
|
||||||
return CreateSExt(V, DestTy, Name);
|
return CreateSExt(V, DestTy, Name);
|
||||||
|
Loading…
Reference in New Issue
Block a user