aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RangeConstraintManager.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-18 17:42:44 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-18 17:42:44 +0000
commite53f8206ebb36a17e95e64270704e2608d1796f4 (patch)
tree0df68acc9825551d39583f9d6ea923fb0c3fad03 /lib/Analysis/RangeConstraintManager.cpp
parentc13c0125a0543f0d994b63a5c3d2474ac12d632d (diff)
Revise comment. Comparing pointer values in 'Range' wasn't the performance issue I thought it was, but it is still worth ordering Range objects by their APSInt values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RangeConstraintManager.cpp')
-rw-r--r--lib/Analysis/RangeConstraintManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Analysis/RangeConstraintManager.cpp b/lib/Analysis/RangeConstraintManager.cpp
index 59e91c1c87..fabc57950f 100644
--- a/lib/Analysis/RangeConstraintManager.cpp
+++ b/lib/Analysis/RangeConstraintManager.cpp
@@ -62,11 +62,9 @@ public:
class VISIBILITY_HIDDEN RangeTrait : public llvm::ImutContainerInfo<Range> {
public:
// When comparing if one Range is less than another, we should compare
- // the actual APSInt values instead of their pointers. This ensures that
- // ImmutableSets based on Range objects always are constructed
- // with the same ordering between Ranges. The definition if 'isEqual' can
- // remain as it is (compare pointers) because all APSInt objects within
- // Range are uniqued by BasicValueManager.
+ // the actual APSInt values instead of their pointers. This keeps the order
+ // consistent (instead of comparing by pointer values) and can potentially
+ // be used to speed up some of the operations in RangeSet.
static inline bool isLess(key_type_ref lhs, key_type_ref rhs) {
return *lhs.first < *rhs.first || (!(*rhs.first < *lhs.first) &&
*lhs.second < *rhs.second);