[vmkit-commits] [vmkit] r181198 - Changed isEqual to vmkIsEqual to avoid conflict with other software
Peter Senna Tschudin
peter.senna at gmail.com
Mon May 6 08:19:28 PDT 2013
Author: peter.senna
Date: Mon May 6 10:19:09 2013
New Revision: 181198
URL: http://llvm.org/viewvc/llvm-project?rev=181198&view=rev
Log:
Changed isEqual to vmkIsEqual to avoid conflict with other software
Modified:
vmkit/trunk/include/vmkit/UTF8.h
vmkit/trunk/include/vmkit/VmkitDenseMap.h
vmkit/trunk/include/vmkit/VmkitDenseSet.h
Modified: vmkit/trunk/include/vmkit/UTF8.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/UTF8.h?rev=181198&r1=181197&r2=181198&view=diff
==============================================================================
--- vmkit/trunk/include/vmkit/UTF8.h (original)
+++ vmkit/trunk/include/vmkit/UTF8.h Mon May 6 10:19:09 2013
@@ -95,8 +95,8 @@ struct VmkitDenseMapInfo<const UTF8*> {
static unsigned getHashValue(const UTF8* PtrVal) {
return PtrVal->hash();
}
- static bool isEqual(const UTF8* LHS, const UTF8* RHS) { return LHS->equals(RHS); }
- static bool isEqualKey(const UTF8* LHS, const UTF8MapKey& Key) {
+ static bool vmkIsEqual(const UTF8* LHS, const UTF8* RHS) { return LHS->equals(RHS); }
+ static bool vmkIsEqualKey(const UTF8* LHS, const UTF8MapKey& Key) {
return LHS->equals(Key.data, Key.length);
}
static UTF8MapKey toKey(const UTF8* utf8) {
@@ -119,7 +119,7 @@ struct VmkitDenseMapInfo<UTF8MapKey> {
static unsigned getHashValue(const UTF8MapKey& key) {
return UTF8::readerHasher(key.data, key.length);
}
- static bool isEqual(const UTF8MapKey& LHS, const UTF8MapKey& RHS) {
+ static bool vmkIsEqual(const UTF8MapKey& LHS, const UTF8MapKey& RHS) {
if (LHS.data == RHS.data) return true;
if (LHS.length != RHS.length) return false;
return !memcmp(LHS.data, RHS.data, RHS.length * sizeof(uint16));
Modified: vmkit/trunk/include/vmkit/VmkitDenseMap.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/VmkitDenseMap.h?rev=181198&r1=181197&r2=181198&view=diff
==============================================================================
--- vmkit/trunk/include/vmkit/VmkitDenseMap.h (original)
+++ vmkit/trunk/include/vmkit/VmkitDenseMap.h Mon May 6 10:19:09 2013
@@ -33,7 +33,7 @@ struct VmkitDenseMapInfo {
//static inline T getEmptyKey();
//static inline T getTombstoneKey();
//static unsigned getHashValue(const T &Val);
- //static bool isEqual(const T &LHS, const T &RHS);
+ //static bool vmkIsEqual(const T &LHS, const T &RHS);
};
template<typename KeyT, typename ValueT,
@@ -71,8 +71,8 @@ public:
~VmkitDenseMap() {
const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (!KeyInfoT::isEqual(P->first, EmptyKey) &&
- !KeyInfoT::isEqual(P->first, TombstoneKey))
+ if (!KeyInfoT::vmkIsEqual(P->first, EmptyKey) &&
+ !KeyInfoT::vmkIsEqual(P->first, TombstoneKey))
P->second.~ValueT();
P->first.~KeyT();
}
@@ -122,8 +122,8 @@ public:
const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (!KeyInfoT::isEqual(P->first, EmptyKey)) {
- if (!KeyInfoT::isEqual(P->first, TombstoneKey)) {
+ if (!KeyInfoT::vmkIsEqual(P->first, EmptyKey)) {
+ if (!KeyInfoT::vmkIsEqual(P->first, TombstoneKey)) {
P->second.~ValueT();
--NumEntries;
}
@@ -258,7 +258,7 @@ private:
}
// If we are writing over a tombstone, remember this.
- if (!KeyInfoT::isEqual(TheBucket->first, getEmptyKey()))
+ if (!KeyInfoT::vmkIsEqual(TheBucket->first, getEmptyKey()))
--NumTombstones;
TheBucket->first = Key;
@@ -294,21 +294,21 @@ private:
BucketT *FoundTombstone = 0;
const KeyT EmptyKey = getEmptyKey();
const KeyT TombstoneKey = getTombstoneKey();
- assert(!KeyInfoT::isEqual(Val, EmptyKey) &&
- !KeyInfoT::isEqual(Val, TombstoneKey) &&
+ assert(!KeyInfoT::vmkIsEqual(Val, EmptyKey) &&
+ !KeyInfoT::vmkIsEqual(Val, TombstoneKey) &&
"Empty/Tombstone value shouldn't be inserted into map!");
while (1) {
BucketT *ThisBucket = BucketsPtr + (BucketNo & (NumBuckets-1));
// Found Val's bucket? If so, return it.
- if (KeyInfoT::isEqual(ThisBucket->first, Val)) {
+ if (KeyInfoT::vmkIsEqual(ThisBucket->first, Val)) {
FoundBucket = ThisBucket;
return true;
}
// If we found an empty bucket, the key doesn't exist in the set.
// Insert it and return the default value.
- if (KeyInfoT::isEqual(ThisBucket->first, EmptyKey)) {
+ if (KeyInfoT::vmkIsEqual(ThisBucket->first, EmptyKey)) {
// If we've already seen a tombstone while probing, fill it in instead
// of the empty bucket we eventually probed to.
if (FoundTombstone) ThisBucket = FoundTombstone;
@@ -318,7 +318,7 @@ private:
// If this is a tombstone, remember it. If Val ends up not in the map, we
// prefer to return it than something that would require more probing.
- if (KeyInfoT::isEqual(ThisBucket->first, TombstoneKey) && !FoundTombstone)
+ if (KeyInfoT::vmkIsEqual(ThisBucket->first, TombstoneKey) && !FoundTombstone)
FoundTombstone = ThisBucket; // Remember the first tombstone found.
// Otherwise, it's a hash collision or a tombstone, continue quadratic
@@ -367,8 +367,8 @@ private:
// Insert all the old elements.
const KeyT TombstoneKey = getTombstoneKey();
for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) {
- if (!KeyInfoT::isEqual(B->first, EmptyKey) &&
- !KeyInfoT::isEqual(B->first, TombstoneKey)) {
+ if (!KeyInfoT::vmkIsEqual(B->first, EmptyKey) &&
+ !KeyInfoT::vmkIsEqual(B->first, TombstoneKey)) {
// Insert the key/value into the new table.
BucketT *DestBucket;
bool FoundVal = LookupBucketFor(B->first, DestBucket);
@@ -413,8 +413,8 @@ private:
// Free the old buckets.
const KeyT TombstoneKey = getTombstoneKey();
for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) {
- if (!KeyInfoT::isEqual(B->first, EmptyKey) &&
- !KeyInfoT::isEqual(B->first, TombstoneKey)) {
+ if (!KeyInfoT::vmkIsEqual(B->first, EmptyKey) &&
+ !KeyInfoT::vmkIsEqual(B->first, TombstoneKey)) {
// Free the value.
B->second.~ValueT();
}
@@ -501,8 +501,8 @@ private:
const KeyT Tombstone = KeyInfoT::getTombstoneKey();
while (Ptr != End &&
- (KeyInfoT::isEqual(Ptr->first, Empty) ||
- KeyInfoT::isEqual(Ptr->first, Tombstone)))
+ (KeyInfoT::vmkIsEqual(Ptr->first, Empty) ||
+ KeyInfoT::vmkIsEqual(Ptr->first, Tombstone)))
++Ptr;
}
};
Modified: vmkit/trunk/include/vmkit/VmkitDenseSet.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/VmkitDenseSet.h?rev=181198&r1=181197&r2=181198&view=diff
==============================================================================
--- vmkit/trunk/include/vmkit/VmkitDenseSet.h (original)
+++ vmkit/trunk/include/vmkit/VmkitDenseSet.h Mon May 6 10:19:09 2013
@@ -59,8 +59,8 @@ public:
~VmkitDenseSet() {
const ValueT EmptyValue = getEmptyValue(), TombstoneValue = getTombstoneValue();
for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (!ValueInfoT::isEqual(*P, EmptyValue) &&
- !ValueInfoT::isEqual(*P, TombstoneValue))
+ if (!ValueInfoT::vmkIsEqual(*P, EmptyValue) &&
+ !ValueInfoT::vmkIsEqual(*P, TombstoneValue))
(*P).~ValueT();
}
#ifndef NDEBUG
@@ -109,8 +109,8 @@ public:
const ValueT EmptyValue = getEmptyValue(), TombstoneValue = getTombstoneValue();
for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
- if (!ValueInfoT::isEqual(*P, EmptyValue)) {
- if (!ValueInfoT::isEqual(*P, TombstoneValue)) {
+ if (!ValueInfoT::vmkIsEqual(*P, EmptyValue)) {
+ if (!ValueInfoT::vmkIsEqual(*P, TombstoneValue)) {
P->~ValueT();
--NumEntries;
}
@@ -244,7 +244,7 @@ private:
}
// If we are writing over a tombstone, remember this.
- if (!ValueInfoT::isEqual(*TheBucket, getEmptyValue()))
+ if (!ValueInfoT::vmkIsEqual(*TheBucket, getEmptyValue()))
--NumTombstones;
new (TheBucket) ValueT(Value);
@@ -283,14 +283,14 @@ private:
while (1) {
BucketT *ThisBucket = BucketsPtr + (BucketNo & (NumBuckets-1));
// Found Val's bucket? If so, return it.
- if (ValueInfoT::isEqualKey(*ThisBucket, Key)) {
+ if (ValueInfoT::vmkIsEqualKey(*ThisBucket, Key)) {
FoundBucket = ThisBucket;
return true;
}
// If we found an empty bucket, the key doesn't exist in the set.
// Insert it and return the default value.
- if (ValueInfoT::isEqual(*ThisBucket, EmptyValue)) {
+ if (ValueInfoT::vmkIsEqual(*ThisBucket, EmptyValue)) {
// If we've already seen a tombstone while probing, fill it in instead
// of the empty bucket we eventually probed to.
if (FoundTombstone) ThisBucket = FoundTombstone;
@@ -300,7 +300,7 @@ private:
// If this is a tombstone, remember it. If Val ends up not in the map, we
// prefer to return it than something that would require more probing.
- if (ValueInfoT::isEqual(*ThisBucket, TombstoneValue) && !FoundTombstone)
+ if (ValueInfoT::vmkIsEqual(*ThisBucket, TombstoneValue) && !FoundTombstone)
FoundTombstone = ThisBucket; // Remember the first tombstone found.
// Otherwise, it's a hash collision or a tombstone, continue quadratic
@@ -349,8 +349,8 @@ private:
// Insert all the old elements.
const ValueT TombstoneValue = getTombstoneValue();
for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) {
- if (!ValueInfoT::isEqual(*B, EmptyValue) &&
- !ValueInfoT::isEqual(*B, TombstoneValue)) {
+ if (!ValueInfoT::vmkIsEqual(*B, EmptyValue) &&
+ !ValueInfoT::vmkIsEqual(*B, TombstoneValue)) {
// Insert the value into the new table.
BucketT *DestBucket;
KeyT key = ValueInfoT::toKey(*B);
@@ -394,8 +394,8 @@ private:
// Free the old buckets.
const ValueT TombstoneValue = getTombstoneValue();
for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) {
- if (!ValueInfoT::isEqual(*B, EmptyValue) &&
- !ValueInfoT::isEqual(*B, TombstoneValue)) {
+ if (!ValueInfoT::vmkIsEqual(*B, EmptyValue) &&
+ !ValueInfoT::vmkIsEqual(*B, TombstoneValue)) {
// Free the value.
(*B).~ValueT();
}
@@ -480,8 +480,8 @@ private:
const ValueT Tombstone = ValueInfoT::getTombstoneKey();
while (Ptr != End &&
- (ValueInfoT::isEqual(*Ptr, Empty) ||
- ValueInfoT::isEqual(*Ptr, Tombstone)))
+ (ValueInfoT::vmkIsEqual(*Ptr, Empty) ||
+ ValueInfoT::vmkIsEqual(*Ptr, Tombstone)))
++Ptr;
}
};
More information about the vmkit-commits
mailing list