1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[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:
Francesco Petrogalli 2020-03-27 21:41:03 +00:00
parent b61c82964d
commit 78350f6cef

View File

@ -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 {