]> granicus.if.org Git - clang/commit
[Coverage] Fix an assertion failure if the definition of an unused function spans...
authorIgor Kudrin <ikudrin.dev@gmail.com>
Tue, 7 Jun 2016 02:17:03 +0000 (02:17 +0000)
committerIgor Kudrin <ikudrin.dev@gmail.com>
Tue, 7 Jun 2016 02:17:03 +0000 (02:17 +0000)
commitf962670a08ef14c8bc5eeeb991078593e0c2ae20
treee28c59594025ec4768e60be8d285d57dcd6f9e98
parent01203ed48e7813969a5995d2b57df6d31dec63ae
[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.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271969 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]