[DebugInfo][PDB] Fix a signed/unsigned coversion warning

Fix the following warning when compiling with clang (caused by commit
rL343951):

GlobalsStream.cpp:61:33: warning: comparison of integers of different
signs: 'int' and 'uint32_t'

This also avoids double evaluation of `GlobalsTable.HashBuckets.size()`.

llvm-svn: 343957
This commit is contained in:
Kristina Brooks 2018-10-08 09:03:17 +00:00
parent fa120cbdbc
commit bcc86a95c1
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ GlobalsStream::findRecordsByName(StringRef Name,
uint32_t ChainStartOffset = GlobalsTable.HashBuckets[CompressedBucketIndex];
uint32_t NextChainStart = GlobalsTable.HashBuckets.size();
if (CompressedBucketIndex + 1 < GlobalsTable.HashBuckets.size())
if (static_cast<uint32_t>(CompressedBucketIndex + 1) < NextChainStart)
NextChainStart = GlobalsTable.HashBuckets[CompressedBucketIndex + 1];
ChainStartOffset /= 12;
NextChainStart /= 12;