mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Fix llvm::ComputeNumSignBits to handle pointer types
conservatively correctly, instead of aborting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73908 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -624,8 +624,12 @@ bool llvm::MaskedValueIsZero(Value *V, const APInt &Mask,
|
||||
/// 'Op' must have a scalar integer type.
|
||||
///
|
||||
unsigned llvm::ComputeNumSignBits(Value *V, TargetData *TD, unsigned Depth) {
|
||||
assert((TD || V->getType()->isIntOrIntVector()) &&
|
||||
"ComputeNumSignBits requires a TargetData object to operate "
|
||||
"on non-integer values!");
|
||||
const Type *Ty = V->getType();
|
||||
unsigned TyBits = Ty->getScalarSizeInBits();
|
||||
unsigned TyBits = TD ? TD->getTypeSizeInBits(V->getType()->getScalarType()) :
|
||||
Ty->getScalarSizeInBits();
|
||||
unsigned Tmp, Tmp2;
|
||||
unsigned FirstAnswer = 1;
|
||||
|
||||
|
Reference in New Issue
Block a user