diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-08-23 17:14:32 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-08-23 17:14:32 +0000 |
commit | 33d7b762d009f52000984804bbbe01ab02b30f66 (patch) | |
tree | f05d418140464705a578cfa505447c15569edd03 /llvm/lib/Support/StringMap.cpp | |
parent | ada2bb3d5d61d541ba5156ae76576b9e5ef45383 (diff) | |
download | bcm5719-llvm-33d7b762d009f52000984804bbbe01ab02b30f66.tar.gz bcm5719-llvm-33d7b762d009f52000984804bbbe01ab02b30f66.zip |
Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D23789
llvm-svn: 279535
Diffstat (limited to 'llvm/lib/Support/StringMap.cpp')
-rw-r--r-- | llvm/lib/Support/StringMap.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Support/StringMap.cpp b/llvm/lib/Support/StringMap.cpp index 7da9ccbd40c..d2315966e32 100644 --- a/llvm/lib/Support/StringMap.cpp +++ b/llvm/lib/Support/StringMap.cpp @@ -14,7 +14,9 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/MathExtras.h" #include <cassert> + using namespace llvm; /// Returns the number of buckets to allocate to ensure that the DenseMap can @@ -63,7 +65,6 @@ void StringMapImpl::init(unsigned InitSize) { TheTable[NumBuckets] = (StringMapEntryBase*)2; } - /// LookupBucketFor - Look up the bucket that the specified string should end /// up in. If it already exists as a key in the map, the Item pointer for the /// specified bucket will be non-null. Otherwise, it will be null. In either @@ -81,7 +82,7 @@ unsigned StringMapImpl::LookupBucketFor(StringRef Name) { unsigned ProbeAmt = 1; int FirstTombstone = -1; - while (1) { + while (true) { StringMapEntryBase *BucketItem = TheTable[BucketNo]; // If we found an empty bucket, this key isn't in the table yet, return it. if (LLVM_LIKELY(!BucketItem)) { @@ -123,7 +124,6 @@ unsigned StringMapImpl::LookupBucketFor(StringRef Name) { } } - /// FindKey - Look up the bucket that contains the specified key. If it exists /// in the map, return the bucket number of the key. Otherwise return -1. /// This does not modify the map. @@ -135,7 +135,7 @@ int StringMapImpl::FindKey(StringRef Key) const { unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1); unsigned ProbeAmt = 1; - while (1) { + while (true) { StringMapEntryBase *BucketItem = TheTable[BucketNo]; // If we found an empty bucket, this key isn't in the table yet, return. if (LLVM_LIKELY(!BucketItem)) @@ -191,8 +191,6 @@ StringMapEntryBase *StringMapImpl::RemoveKey(StringRef Key) { return Result; } - - /// RehashTable - Grow the table, redistributing values into the buckets with /// the appropriate mod-of-hashtable-size. unsigned StringMapImpl::RehashTable(unsigned BucketNo) { |