[PATCH] D117114: [llvm][ADT] Implement `BitVector(std::initializer_list)`

Jan Svoboda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 12 07:02:07 PST 2022


jansvoboda11 created this revision.
jansvoboda11 added a reviewer: dexonsmith.
Herald added subscribers: pengfei, hiraditya.
jansvoboda11 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.

Currently, there's no easy way to create `llvm::BitVector` with statically known bit pattern. Absence of convenient functionality like this may sway people to use `std::vector<bool>` instead.

This patch adds new `std::initializer_list`-based constructor that servers this purpose.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117114

Files:
  llvm/include/llvm/ADT/BitVector.h
  llvm/include/llvm/ADT/SmallBitVector.h
  llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
  llvm/lib/CodeGen/MachineCheckDebugify.cpp
  llvm/lib/Target/X86/ImmutableGraph.h
  llvm/lib/Transforms/Utils/Debugify.cpp
  llvm/unittests/ADT/BitVectorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117114.399318.patch
Type: text/x-patch
Size: 5381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220112/9176f763/attachment.bin>


More information about the llvm-commits mailing list