Skip to content

Commit

Permalink
add hook for manually adding coverage data (JuliaLang#41904)
Browse files Browse the repository at this point in the history
This would allow packages like JuliaInterpreter to properly report
coverage data.
  • Loading branch information
simeonschaub authored Aug 18, 2021
1 parent f738580 commit 5a39be8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,16 @@ static void coverageAllocLine(StringRef filename, int line)
allocLine(coverageData[filename], line);
}

extern "C" JL_DLLEXPORT void jl_coverage_visit_line(const char* filename_, size_t len_filename, int line)
{
StringRef filename = StringRef(filename_, len_filename);
if (imaging_mode || filename == "" || filename == "none" || filename == "no file" || filename == "<missing>" || line < 0)
return;
std::vector<logdata_block*> &vec = coverageData[filename];
uint64_t *ptr = allocLine(vec, line);
(*ptr)++;
}

// Memory allocation log (malloc_log)

static logdata_t mallocData;
Expand Down

0 comments on commit 5a39be8

Please sign in to comment.