This is an archive of the discontinued LLVM Phabricator instance.

[llvm][Type] Return fixed size for scalar types. [NFC]
ClosedPublic

Authored by fpetrogalli on Mar 26 2020, 3:52 PM.

Details

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.

Diff Detail

Event Timeline

fpetrogalli created this revision.Mar 26 2020, 3:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2020, 3:52 PM
efriedma accepted this revision.Mar 26 2020, 4:42 PM

LGTM

llvm/lib/IR/Type.cpp
135–136

"It is safe"?

This revision is now accepted and ready to land.Mar 26 2020, 4:42 PM

Fixed the typo in the comment.

fpetrogalli marked an inline comment as done.Mar 27 2020, 2:45 PM
This revision was automatically updated to reflect the committed changes.