[cfe-commits] r64921 - /cfe/trunk/lib/Analysis/RangeConstraintManager.cpp

Ted Kremenek kremenek at apple.com
Wed Feb 18 09:42:44 PST 2009

Author: kremenek
Date: Wed Feb 18 11:42:44 2009
New Revision: 64921

URL: http://llvm.org/viewvc/llvm-project?rev=64921&view=rev
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.


Modified: cfe/trunk/lib/Analysis/RangeConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RangeConstraintManager.cpp?rev=64921&r1=64920&r2=64921&view=diff

--- cfe/trunk/lib/Analysis/RangeConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/RangeConstraintManager.cpp Wed Feb 18 11:42:44 2009
@@ -62,11 +62,9 @@
 class VISIBILITY_HIDDEN RangeTrait : public llvm::ImutContainerInfo<Range> {
   // 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);

More information about the cfe-commits mailing list