mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140789 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5ef699f41
commit
0066f9290e
@ -27,6 +27,16 @@ GCOVFile::~GCOVFile() {
|
|||||||
DeleteContainerPointers(Functions);
|
DeleteContainerPointers(Functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// isGCDAFile - Return true if Format identifies a .gcda file.
|
||||||
|
static bool isGCDAFile(GCOVFormat Format) {
|
||||||
|
return Format == GCDA_402 || Format == GCDA_404;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// isGCNOFile - Return true if Format identifies a .gcno file.
|
||||||
|
static bool isGCNOFile(GCOVFormat Format) {
|
||||||
|
return Format == GCNO_402 || Format == GCNO_404;
|
||||||
|
}
|
||||||
|
|
||||||
/// read - Read GCOV buffer.
|
/// read - Read GCOV buffer.
|
||||||
bool GCOVFile::read(GCOVBuffer &Buffer) {
|
bool GCOVFile::read(GCOVBuffer &Buffer) {
|
||||||
GCOVFormat Format = Buffer.readGCOVFormat();
|
GCOVFormat Format = Buffer.readGCOVFormat();
|
||||||
@ -36,20 +46,16 @@ bool GCOVFile::read(GCOVBuffer &Buffer) {
|
|||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
GCOVFunction *GFun = NULL;
|
GCOVFunction *GFun = NULL;
|
||||||
if (Format == GCDA_402 || Format == GCDA_404) {
|
if (isGCDAFile(Format)) {
|
||||||
if (i < Functions.size())
|
// Use existing function while reading .gcda file.
|
||||||
GFun = Functions[i];
|
assert (i < Functions.size() && ".gcda data does not match .gcno data");
|
||||||
} else
|
GFun = Functions[i];
|
||||||
|
} else if (isGCNOFile(Format)){
|
||||||
GFun = new GCOVFunction();
|
GFun = new GCOVFunction();
|
||||||
|
Functions.push_back(GFun);
|
||||||
if (GFun && GFun->read(Buffer, Format)) {
|
|
||||||
if (Format == GCNO_402 || Format == GCNO_404)
|
|
||||||
Functions.push_back(GFun);
|
|
||||||
}
|
}
|
||||||
else {
|
if (!GFun || !GFun->read(Buffer, Format))
|
||||||
delete GFun;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user