[PATCH] D51693: ADT: add <bit> header, implement C++20 bit_cast, use

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 5 10:38:28 PDT 2018


jfb created this revision.
Herald added a reviewer: javed.absar.
Herald added subscribers: llvm-commits, dexonsmith.

I saw a few places that were punning through a union of FP and integer, and that made me sad. Luckily, C++20 adds bit_cast for exactly that purpose. Implement our own version in ADT (without constexpr, leaving us a bit sad), and use it in the few places my grep-fu found silly union punning.


Repository:
  rL LLVM

https://reviews.llvm.org/D51693

Files:
  include/llvm/ADT/bit.h
  lib/Support/APInt.cpp
  lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h
  lib/Target/ARM/MCTargetDesc/ARMAddressingModes.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51693.164072.patch
Type: text/x-patch
Size: 5720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180905/3d711ce1/attachment-0001.bin>


More information about the llvm-commits mailing list