]> granicus.if.org Git - clang/commit
Reapply [Coverage] Fix an assertion failure if the definition of an unused function...
authorIgor Kudrin <ikudrin.dev@gmail.com>
Tue, 7 Jun 2016 10:07:51 +0000 (10:07 +0000)
committerIgor Kudrin <ikudrin.dev@gmail.com>
Tue, 7 Jun 2016 10:07:51 +0000 (10:07 +0000)
commit10ab2e45436c50e4cfe1024839280d85fdc2082c
tree52ad7a40a4216e1ccb7c81de6e5bc726c420064d
parent9ab2c541fad8aeb80c35f4ecdd765c77641e62cf
Reapply [Coverage] Fix an assertion failure if the definition of an unused function spans multiple files.

We have an assertion failure if, for example, the definition of an unused
inline function starts in one macro and ends in another. This patch fixes
the issue by finding the common ancestor of the start and end locations
of that function's body and changing the locations accordingly.

Thanks to NAKAMURA Takumi for helping with fixing the test failure on Windows.

Differential Revision: http://reviews.llvm.org/D20997

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271995 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CoverageMappingGen.cpp
test/CoverageMapping/Inputs/ends_a_scope_only [new file with mode: 0644]
test/CoverageMapping/Inputs/starts_a_scope_only [new file with mode: 0644]
test/CoverageMapping/unused_function.cpp [new file with mode: 0644]