From 28753f8df2921fa9e9d60717c2078c826ea82bb4 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sat, 14 Jul 2007 17:41:03 +0000 Subject: [PATCH] Clarify the language. Pointed out by Duncan Sands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39857 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/ConstantRange.h | 7 +++++-- lib/Support/ConstantRange.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h index 00c525ebf32..778827c0e0f 100644 --- a/include/llvm/Support/ConstantRange.h +++ b/include/llvm/Support/ConstantRange.h @@ -145,8 +145,11 @@ class ConstantRange { /// maximalIntersectWith - 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 is also - /// guaranteed to be the smallest possible set that does so. + /// include all elements contained in both input ranges, and to have the + /// smallest possible set size that does so. Because there may be two + /// intersections with the same set size, A.maximalIntersectWith(B) might not + /// be equal to B.maximalIntersectWith(A). + /// ConstantRange maximalIntersectWith(const ConstantRange &CR) const; /// unionWith - Return the range that results from the union of this range diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp index 4f132e5ed5f..fdfe28aaa95 100644 --- a/lib/Support/ConstantRange.cpp +++ b/lib/Support/ConstantRange.cpp @@ -248,8 +248,10 @@ ConstantRange ConstantRange::intersectWith(const ConstantRange &CR) const { /// maximalIntersectWith - 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 is also guaranteed -/// to be the smallest possible set that does so. +/// include all elements contained in both input ranges, and to have the +/// smallest possible set size that does so. Because there may be two +/// intersections with the same set size, A.maximalIntersectWith(B) might not +/// be equal to B.maximalIntersect(A). ConstantRange ConstantRange::maximalIntersectWith(const ConstantRange &CR) const { assert(getBitWidth() == CR.getBitWidth() && "ConstantRange types don't agree!");