OSDN Git Service

[ConstantRange] Add getNonEmpty() constructor
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 21 Apr 2019 15:22:54 +0000 (15:22 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 21 Apr 2019 15:22:54 +0000 (15:22 +0000)
commitbfce43af72b6cece79552742674420d4f232dd4e
treed6b5d16c79d34542e7c6a7001a238b0d6cb2bee2
parente1f80841ddaa4af431e61446daf70120c8bf87ab
[ConstantRange] Add getNonEmpty() constructor

ConstantRanges have an annoying special case: If upper and lower are
the same, it can be either an empty or a full set. When constructing
constant ranges nearly always a full set is intended, but this still
requires an explicit check in many places.

This revision adds a getNonEmpty() constructor that disambiguates this
case: If upper and lower are the same, a full set is created.

Differential Revision: https://reviews.llvm.org/D60947

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358854 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/ConstantRange.h
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ValueTracking.cpp
lib/IR/ConstantRange.cpp