[PATCH] D20286: [Coverage] Fix an issue where improper coverage mapping data could be loaded for an inline function.

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 11:26:50 PDT 2016


David Li <davidxl at google.com> writes:
> davidxl added a comment.
>
> It is possible to handle this without requiring changing the hash value.
>
> What is needed is a helper method to check if the coverageMapping record is 'dummy' -- i.e. has any execution count. It not, it can be skipped or replaced.
>
> See CoverageMapping::load method:
>
>   ErrorOr<int64_t> ExecutionCount = Ctx.evaluate(Region.Count);
>    if (!ExecutionCount)
>      break;

I agree, this is a better way to solve this problem. As a bonus, I
expect the intent of the code will be clearer with this approach.


More information about the llvm-commits mailing list