mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
llvm-cov: Handle functions with no line number
Functions may in an instrumented binary but not in the original source when they're inserted by the compiler or the runtime. These functions aren't meaningful to the user, so teach llvm-cov to skip over them instead of crashing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204863 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -308,6 +308,11 @@ void GCOVFunction::dump() const {
|
||||
/// collectLineCounts - Collect line counts. This must be used after
|
||||
/// reading .gcno and .gcda files.
|
||||
void GCOVFunction::collectLineCounts(FileInfo &FI) {
|
||||
// If the line number is zero, this is a function that doesn't actually appear
|
||||
// in the source file, so there isn't anything we can do with it.
|
||||
if (LineNumber == 0)
|
||||
return;
|
||||
|
||||
for (SmallVectorImpl<GCOVBlock *>::iterator I = Blocks.begin(),
|
||||
E = Blocks.end(); I != E; ++I)
|
||||
(*I)->collectLineCounts(FI);
|
||||
|
Reference in New Issue
Block a user