summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitstreamReader.cpp
diff options
context:
space:
mode:
authorJakub Staszak <kubastaszak@gmail.com>2013-02-19 09:48:30 +0000
committerJakub Staszak <kubastaszak@gmail.com>2013-02-19 09:48:30 +0000
commit977def1acc6f043a4fcde60aca77fe03453718f9 (patch)
tree34bc0546ccc38c9cdee4b96e75a6ecf71197c5e9 /llvm/lib/Bitcode/Reader/BitstreamReader.cpp
parent58f427ee41fc0623c68b0d777b973339fbe73a26 (diff)
downloadbcm5719-llvm-977def1acc6f043a4fcde60aca77fe03453718f9.tar.gz
bcm5719-llvm-977def1acc6f043a4fcde60aca77fe03453718f9.zip
Simplify code. No functionality change.
llvm-svn: 175501
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitstreamReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitstreamReader.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp
index b1335029a75..942346b44e3 100644
--- a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp
@@ -26,34 +26,28 @@ void BitstreamCursor::operator=(const BitstreamCursor &RHS) {
// Copy abbreviations, and bump ref counts.
CurAbbrevs = RHS.CurAbbrevs;
- for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
- i != e; ++i)
+ for (size_t i = 0, e = CurAbbrevs.size(); i != e; ++i)
CurAbbrevs[i]->addRef();
// Copy block scope and bump ref counts.
BlockScope = RHS.BlockScope;
- for (unsigned S = 0, e = static_cast<unsigned>(BlockScope.size());
- S != e; ++S) {
+ for (size_t S = 0, e = BlockScope.size(); S != e; ++S) {
std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
- for (unsigned i = 0, e = static_cast<unsigned>(Abbrevs.size());
- i != e; ++i)
+ for (size_t i = 0, e = Abbrevs.size(); i != e; ++i)
Abbrevs[i]->addRef();
}
}
void BitstreamCursor::freeState() {
// Free all the Abbrevs.
- for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
- i != e; ++i)
+ for (size_t i = 0, e = CurAbbrevs.size(); i != e; ++i)
CurAbbrevs[i]->dropRef();
CurAbbrevs.clear();
// Free all the Abbrevs in the block scope.
- for (unsigned S = 0, e = static_cast<unsigned>(BlockScope.size());
- S != e; ++S) {
+ for (size_t S = 0, e = BlockScope.size(); S != e; ++S) {
std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
- for (unsigned i = 0, e = static_cast<unsigned>(Abbrevs.size());
- i != e; ++i)
+ for (size_t i = 0, e = Abbrevs.size(); i != e; ++i)
Abbrevs[i]->dropRef();
}
BlockScope.clear();
@@ -69,8 +63,7 @@ bool BitstreamCursor::EnterSubBlock(unsigned BlockID, unsigned *NumWordsP) {
// Add the abbrevs specific to this block to the CurAbbrevs list.
if (const BitstreamReader::BlockInfo *Info =
BitStream->getBlockInfo(BlockID)) {
- for (unsigned i = 0, e = static_cast<unsigned>(Info->Abbrevs.size());
- i != e; ++i) {
+ for (size_t i = 0, e = Info->Abbrevs.size(); i != e; ++i) {
CurAbbrevs.push_back(Info->Abbrevs[i]);
CurAbbrevs.back()->addRef();
}
OpenPOWER on IntegriCloud