summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
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
commitab89bc8ca1d93f7052daff3b7ca3b361fc83a47b (patch)
treec48227c2ca1f877f73c0dfe5784e8311fa6ae01b /clang/lib/Analysis
parent66c5a1dd5073458f0b4ed38719f737d5500eeae0 (diff)
downloadbcm5719-llvm-ab89bc8ca1d93f7052daff3b7ca3b361fc83a47b.tar.gz
bcm5719-llvm-ab89bc8ca1d93f7052daff3b7ca3b361fc83a47b.zip
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.
llvm-svn: 64921
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/RangeConstraintManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Analysis/RangeConstraintManager.cpp b/clang/lib/Analysis/RangeConstraintManager.cpp
index 59e91c1c87d..fabc57950ff 100644
--- a/clang/lib/Analysis/RangeConstraintManager.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud