Instead, pass name pointers to InstrProfiling::lowerCoverageData() using
the new API (via getCoverageUnusedNamesVarName). This ensures that we
don't emit an uncompressed *and* a compressed version of all function
names into the module, fixing rdar://problem/25493310.
(cherry picked from commit 668d81f1f3)
Fix a crash in emitBuiltinCall() which occurs because we drop function
linkage information when creating SILCoverageMaps.
This re-applies 45c7e4e86 with the MachO-specific checks in the test
case removed.
Update our usage of llvm's coverage API and fix the way we lower
instrprof_increment intrinsics.
This keeps us up-to-date with llvm/stable and makes instrumented IR
easier to read.
Changes to the coverage mapping API in upstream llvm have caused merge
conflicts and breakage in swift. This commit phases in bits of the new
API in a way that can be safely cherry-picked to swift-{2.2,3.0}-branch.
This commit is NFC for master-next and swift-2.2-branch, but constitutes
an actual bugfix for 3.0. That's because 3.0 is paired with a version of
llvm that takes advantage of the new coverage API to reduce the size of
instrumented binaries.
This effectively closes Swift PR-1053.
(cherry picked from commit a079d313fe)
We emit an extra byte in the name field of function mapping records. The
extra null byte confuses llvm InstrProfReader, resulting in a loss of
coverage information.
We need execution tests to prevent this sort of issue from arising in
the future. Before that can happen, swift needs to start maintaining its
own branches of compiler-rt (this is SR-601).
Swift PR 1051, rdar://problem/24267336
(cherry picked from commit a476c2828a)
If multiple swift files are compiled together, then guessing as to the
file when we emit IR obviously doesn't work. Find the filename when we
generate a function's coverage map and propagate it through SIL.
Swift SVN r25436