Page MenuHomePhabricator

[flang][msvc] Avoid a reinterpret_cast

Authored by klausler on Oct 14 2020, 4:37 PM.



The call to the binary->decimal formatter in real.cpp was cheating
by using a reinterpret_cast<> to extract its binary value.
Use a more principled and portable approach by extending the
API of evaluate::Integer<> to include ToUInt<>()/ToSInt<>()
member function templates that do the "right" thing. Retain
ToUInt64()/ToSInt64() for compatibility.

Proposed as an alternative to

Diff Detail

Event Timeline

klausler created this revision.Oct 14 2020, 4:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2020, 4:37 PM
Meinersbur accepted this revision.Oct 15 2020, 7:43 AM

Works fine with msvc.

This revision is now accepted and ready to land.Oct 15 2020, 7:43 AM
This revision was automatically updated to reflect the committed changes.