mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175501 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -26,34 +26,28 @@ void BitstreamCursor::operator=(const BitstreamCursor &RHS) {
|
|||||||
|
|
||||||
// Copy abbreviations, and bump ref counts.
|
// Copy abbreviations, and bump ref counts.
|
||||||
CurAbbrevs = RHS.CurAbbrevs;
|
CurAbbrevs = RHS.CurAbbrevs;
|
||||||
for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
|
for (size_t i = 0, e = CurAbbrevs.size(); i != e; ++i)
|
||||||
i != e; ++i)
|
|
||||||
CurAbbrevs[i]->addRef();
|
CurAbbrevs[i]->addRef();
|
||||||
|
|
||||||
// Copy block scope and bump ref counts.
|
// Copy block scope and bump ref counts.
|
||||||
BlockScope = RHS.BlockScope;
|
BlockScope = RHS.BlockScope;
|
||||||
for (unsigned S = 0, e = static_cast<unsigned>(BlockScope.size());
|
for (size_t S = 0, e = BlockScope.size(); S != e; ++S) {
|
||||||
S != e; ++S) {
|
|
||||||
std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
|
std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
|
||||||
for (unsigned i = 0, e = static_cast<unsigned>(Abbrevs.size());
|
for (size_t i = 0, e = Abbrevs.size(); i != e; ++i)
|
||||||
i != e; ++i)
|
|
||||||
Abbrevs[i]->addRef();
|
Abbrevs[i]->addRef();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitstreamCursor::freeState() {
|
void BitstreamCursor::freeState() {
|
||||||
// Free all the Abbrevs.
|
// Free all the Abbrevs.
|
||||||
for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
|
for (size_t i = 0, e = CurAbbrevs.size(); i != e; ++i)
|
||||||
i != e; ++i)
|
|
||||||
CurAbbrevs[i]->dropRef();
|
CurAbbrevs[i]->dropRef();
|
||||||
CurAbbrevs.clear();
|
CurAbbrevs.clear();
|
||||||
|
|
||||||
// Free all the Abbrevs in the block scope.
|
// Free all the Abbrevs in the block scope.
|
||||||
for (unsigned S = 0, e = static_cast<unsigned>(BlockScope.size());
|
for (size_t S = 0, e = BlockScope.size(); S != e; ++S) {
|
||||||
S != e; ++S) {
|
|
||||||
std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
|
std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
|
||||||
for (unsigned i = 0, e = static_cast<unsigned>(Abbrevs.size());
|
for (size_t i = 0, e = Abbrevs.size(); i != e; ++i)
|
||||||
i != e; ++i)
|
|
||||||
Abbrevs[i]->dropRef();
|
Abbrevs[i]->dropRef();
|
||||||
}
|
}
|
||||||
BlockScope.clear();
|
BlockScope.clear();
|
||||||
@ -69,8 +63,7 @@ bool BitstreamCursor::EnterSubBlock(unsigned BlockID, unsigned *NumWordsP) {
|
|||||||
// Add the abbrevs specific to this block to the CurAbbrevs list.
|
// Add the abbrevs specific to this block to the CurAbbrevs list.
|
||||||
if (const BitstreamReader::BlockInfo *Info =
|
if (const BitstreamReader::BlockInfo *Info =
|
||||||
BitStream->getBlockInfo(BlockID)) {
|
BitStream->getBlockInfo(BlockID)) {
|
||||||
for (unsigned i = 0, e = static_cast<unsigned>(Info->Abbrevs.size());
|
for (size_t i = 0, e = Info->Abbrevs.size(); i != e; ++i) {
|
||||||
i != e; ++i) {
|
|
||||||
CurAbbrevs.push_back(Info->Abbrevs[i]);
|
CurAbbrevs.push_back(Info->Abbrevs[i]);
|
||||||
CurAbbrevs.back()->addRef();
|
CurAbbrevs.back()->addRef();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user