diff options
Diffstat (limited to 'llvm/lib/Support/ConstantRange.cpp')
| -rw-r--r-- | llvm/lib/Support/ConstantRange.cpp | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp index 61d333f24a0..91d086b6890 100644 --- a/llvm/lib/Support/ConstantRange.cpp +++ b/llvm/lib/Support/ConstantRange.cpp @@ -248,6 +248,12 @@ ConstantRange ConstantRange::subtract(const APInt &Val) const {    return ConstantRange(Lower - Val, Upper - Val);  } +/// \brief Subtract the specified range from this range (aka relative complement +/// of the sets). +ConstantRange ConstantRange::difference(const ConstantRange &CR) const { +  return intersectWith(CR.inverse()); +} +  /// intersectWith - Return the range that results from the intersection of this  /// range with another range.  The resultant range is guaranteed to include all  /// elements contained in both input ranges, and to have the smallest possible  | 

