forked from OSchip/llvm-project
[llvm][Type] Return fixed size for scalar types. [NFC]
Summary: It is safe to assume that the TypeSize associated to scalar types has a fixed size. This avoids an implicit cast of TypeSize to integer inside `Type::getScalarSizeInBits()`, as such implicit cast is deprecated. Reviewers: efriedma, sdesmalen Reviewed By: efriedma Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76892
This commit is contained in:
parent
9ce198d6ed
commit
4b3d94051c
|
@ -132,7 +132,8 @@ TypeSize Type::getPrimitiveSizeInBits() const {
|
|||
}
|
||||
|
||||
unsigned Type::getScalarSizeInBits() const {
|
||||
return getScalarType()->getPrimitiveSizeInBits();
|
||||
// It is safe to assume that the scalar types have a fixed size.
|
||||
return getScalarType()->getPrimitiveSizeInBits().getFixedSize();
|
||||
}
|
||||
|
||||
int Type::getFPMantissaWidth() const {
|
||||
|
|
Loading…
Reference in New Issue