aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Bitcode/BitstreamReader.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-05-05 18:30:58 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-05-05 18:30:58 +0000
commit34cd4a484e532cc463fd5a4bf59b88d13c5467c1 (patch)
treeeefdfb1d225da0317e7f7912079c430b5c3ed92c /include/llvm/Bitcode/BitstreamReader.h
parentb61bfdb56e1c018f10a2c1c9fb49d7e2a78ed24e (diff)
Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Bitcode/BitstreamReader.h')
-rw-r--r--include/llvm/Bitcode/BitstreamReader.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h
index 456f1ce5a1..3b7a9b61e6 100644
--- a/include/llvm/Bitcode/BitstreamReader.h
+++ b/include/llvm/Bitcode/BitstreamReader.h
@@ -85,12 +85,15 @@ public:
~BitstreamReader() {
// Abbrevs could still exist if the stream was broken. If so, don't leak
// them.
- for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
+ for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
+ i != e; ++i)
CurAbbrevs[i]->dropRef();
- for (unsigned S = 0, e = BlockScope.size(); S != e; ++S) {
+ for (unsigned S = 0, e = static_cast<unsigned>(BlockScope.size());
+ S != e; ++S) {
std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
- for (unsigned i = 0, e = Abbrevs.size(); i != e; ++i)
+ for (unsigned i = 0, e = static_cast<unsigned>(Abbrevs.size());
+ i != e; ++i)
Abbrevs[i]->dropRef();
}
@@ -98,7 +101,8 @@ public:
while (!BlockInfoRecords.empty()) {
BlockInfo &Info = BlockInfoRecords.back();
// Free blockinfo abbrev info.
- for (unsigned i = 0, e = Info.Abbrevs.size(); i != e; ++i)
+ for (unsigned i = 0, e = static_cast<unsigned>(Info.Abbrevs.size());
+ i != e; ++i)
Info.Abbrevs[i]->dropRef();
BlockInfoRecords.pop_back();
}
@@ -127,7 +131,7 @@ public:
// Skip over any bits that are already consumed.
if (WordBitNo) {
NextChar -= 4;
- Read(WordBitNo);
+ Read(static_cast<unsigned>(WordBitNo));
}
}
@@ -237,7 +241,8 @@ private:
if (!BlockInfoRecords.empty() && BlockInfoRecords.back().BlockID == BlockID)
return &BlockInfoRecords.back();
- for (unsigned i = 0, e = BlockInfoRecords.size(); i != e; ++i)
+ for (unsigned i = 0, e = static_cast<unsigned>(BlockInfoRecords.size());
+ i != e; ++i)
if (BlockInfoRecords[i].BlockID == BlockID)
return &BlockInfoRecords[i];
return 0;
@@ -282,7 +287,8 @@ public:
// Add the abbrevs specific to this block to the CurAbbrevs list.
if (BlockInfo *Info = getBlockInfo(BlockID)) {
- for (unsigned i = 0, e = Info->Abbrevs.size(); i != e; ++i) {
+ for (unsigned i = 0, e = static_cast<unsigned>(Info->Abbrevs.size());
+ i != e; ++i) {
CurAbbrevs.push_back(Info->Abbrevs[i]);
CurAbbrevs.back()->addRef();
}
@@ -317,7 +323,8 @@ private:
CurCodeSize = BlockScope.back().PrevCodeSize;
// Delete abbrevs from popped scope.
- for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
+ for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
+ i != e; ++i)
CurAbbrevs[i]->dropRef();
BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);