This is an archive of the discontinued LLVM Phabricator instance.

[ConstantRange] Add getNonEmpty() constructor
ClosedPublic

Authored by nikic on Apr 21 2019, 5:22 AM.

Details

Summary

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. This 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.

Diff Detail

Repository
rL LLVM

Event Timeline

nikic created this revision.Apr 21 2019, 5:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2019, 5:22 AM
lebedev.ri accepted this revision.Apr 21 2019, 5:54 AM

I assume that you have verified that there is already
reasonable test coverage for all of these affected functions?

The change itself appears correct to me, LG.

This revision is now accepted and ready to land.Apr 21 2019, 5:54 AM
This revision was automatically updated to reflect the committed changes.