[all-commits] [llvm/llvm-project] 2aad6a: [flang][msvc] Avoid a reinterpret_cast

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Oct 15 10:39:32 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2aad6a0884e3372fef8176902cf984d2f385d938
      https://github.com/llvm/llvm-project/commit/2aad6a0884e3372fef8176902cf984d2f385d938
  Author: peter klausler <pklausler at nvidia.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M flang/include/flang/Evaluate/integer.h
    M flang/lib/Evaluate/real.cpp

  Log Message:
  -----------
  [flang][msvc] Avoid a reinterpret_cast

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.

Differential revision: https://reviews.llvm.org/D89435




More information about the All-commits mailing list