Page MenuHomePhabricator

[lldb/Utility] Simplify Scalar handling of float types
ClosedPublic

Authored by labath on Aug 19 2020, 8:26 AM.

Details

Summary

Similarly to D85836, collapse all Scalar float types to a single enum
value, and use APFloat semantics to differentiate between. This
simplifies the code, and opens to door to supporting other floating
point semantics (which would be needed for fully supporting
architectures with more interesting float types such as PPC).

Diff Detail

Event Timeline

labath created this revision.Aug 19 2020, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2020, 8:26 AM
labath requested review of this revision.Aug 19 2020, 8:26 AM
JDevlieghere accepted this revision.Aug 19 2020, 9:24 AM
JDevlieghere added inline comments.
lldb/source/Utility/Scalar.cpp
68

std::array or ArrayRef maybe?

This revision is now accepted and ready to land.Aug 19 2020, 9:24 AM
labath marked an inline comment as done.Aug 20 2020, 7:18 AM
labath added inline comments.
lldb/source/Utility/Scalar.cpp
68

With a std::array, I'd have to explicitly specify the size, and I'm _really_ not sure what would happen with an ArrayRef (I think it would end up as a dangling pointer).

Given that it has just one usage, I don't think this is an issue. Even with multiple usages, I think it'd be fine to declare the variable this way, but that have an accessor which would wrap it in an ArrayRef for easier manipulation.

This revision was landed with ongoing or failed builds.Aug 20 2020, 7:26 AM
This revision was automatically updated to reflect the committed changes.
labath marked an inline comment as done.