[PATCH] D59716: [ConstantRange] Add full() + empty() named constructors (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 14:04:20 PDT 2019


nikic created this revision.
nikic added reviewers: lebedev.ri, spatel.
Herald added subscribers: llvm-commits, hiraditya, sanjoy.
Herald added a project: LLVM.

This adds `ConstantRange::full(BitWidth)` and `ConstantRange::empty(BitWidth)` named constructors as more readable alternatives to the current `ConstantRange(BitWidth, /* full */ false)` and similar. Additionally private `full()` and `empty()` member functions are added which return a full/empty range with the same bit width -- these are commonly needed inside `ConstantRange.cpp`.

I've also made the `IsFullSet` argument in the `ConstantRange(BitWidth, IsFullSet)` constructor mandatory, though I could drop that part if there is a BC concern here.


Repository:
  rL LLVM

https://reviews.llvm.org/D59716

Files:
  llvm/include/llvm/IR/ConstantRange.h
  llvm/lib/Analysis/LazyValueInfo.cpp
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/IR/ConstantRange.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Transforms/Scalar/Float2Int.cpp
  llvm/lib/Transforms/Utils/LowerSwitch.cpp
  llvm/unittests/IR/ConstantRangeTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59716.191945.patch
Type: text/x-patch
Size: 26166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190322/dcda5410/attachment.bin>


More information about the llvm-commits mailing list