mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 17:29:19 +00:00
llvm-cov: fix a typo and rename a variable.
Rename Size to EndPos, which makes more sense because the variable stores the last location of the blocks. Patch by Yuchen Wu! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
01b0e94bb7
commit
0a2463c990
@ -85,7 +85,7 @@ GCOVFunction::~GCOVFunction() {
|
|||||||
DeleteContainerPointers(Blocks);
|
DeleteContainerPointers(Blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// read - Read a aunction from the buffer. Return false if buffer cursor
|
/// read - Read a function from the buffer. Return false if buffer cursor
|
||||||
/// does not point to a function tag.
|
/// does not point to a function tag.
|
||||||
bool GCOVFunction::read(GCOVBuffer &Buff, GCOV::GCOVFormat Format) {
|
bool GCOVFunction::read(GCOVBuffer &Buff, GCOV::GCOVFormat Format) {
|
||||||
if (!Buff.readFunctionTag())
|
if (!Buff.readFunctionTag())
|
||||||
@ -136,14 +136,14 @@ bool GCOVFunction::read(GCOVBuffer &Buff, GCOV::GCOVFormat Format) {
|
|||||||
// read line table.
|
// read line table.
|
||||||
while (Buff.readLineTag()) {
|
while (Buff.readLineTag()) {
|
||||||
uint32_t LineTableLength = Buff.readInt();
|
uint32_t LineTableLength = Buff.readInt();
|
||||||
uint32_t Size = Buff.getCursor() + LineTableLength*4;
|
uint32_t EndPos = Buff.getCursor() + LineTableLength*4;
|
||||||
uint32_t BlockNo = Buff.readInt();
|
uint32_t BlockNo = Buff.readInt();
|
||||||
assert(BlockNo < BlockCount && "Unexpected Block number!");
|
assert(BlockNo < BlockCount && "Unexpected Block number!");
|
||||||
GCOVBlock *Block = Blocks[BlockNo];
|
GCOVBlock *Block = Blocks[BlockNo];
|
||||||
Buff.readInt(); // flag
|
Buff.readInt(); // flag
|
||||||
while (Buff.getCursor() != (Size - 4)) {
|
while (Buff.getCursor() != (EndPos - 4)) {
|
||||||
StringRef Filename = Buff.readString();
|
StringRef Filename = Buff.readString();
|
||||||
if (Buff.getCursor() == (Size - 4)) break;
|
if (Buff.getCursor() == (EndPos - 4)) break;
|
||||||
while (uint32_t L = Buff.readInt())
|
while (uint32_t L = Buff.readInt())
|
||||||
Block->addLine(Filename, L);
|
Block->addLine(Filename, L);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user