From bf42cfd75fcaf6a98e8781cb49c07c181f6b4330 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 18 Feb 2015 21:24:51 +0000 Subject: InstrProf: Rewrite most of coverage mapping generation in a simpler way The coverage mapping generation code previously generated a large number of redundant coverage regions and then tried to merge similar ones back together. This then relied on some awkward heuristics to prevent combining of regions that were importantly different but happened to have the same count. The end result was inefficient and hard to follow. Now, we more carefully create the regions we actually want. This makes it much easier to create regions at precise locations as well as making the basic approach quite a bit easier to follow. There's still a fair bit of complexity here dealing with included code and macro expansions, but that's pretty hard to avoid without significantly reducing the quality of data we provide. I had to modify quite a few tests where the source ranges became more precise or the old ranges seemed to be wrong anyways, and I've added quite a few new tests since a large number of constructs didn't seem to be tested before. llvm-svn: 229748 --- clang/test/CoverageMapping/header.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'clang/test/CoverageMapping/header.cpp') diff --git a/clang/test/CoverageMapping/header.cpp b/clang/test/CoverageMapping/header.cpp index 0cff9d8e0b6..e495d5a6285 100644 --- a/clang/test/CoverageMapping/header.cpp +++ b/clang/test/CoverageMapping/header.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name tu1.cpp %s > %tmapping +// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name header.cpp %s > %tmapping // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-FUNC // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-STATIC-FUNC // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-STATIC-FUNC2 @@ -14,14 +14,11 @@ int main() { // CHECK-FUNC: File 0, 4:25 -> 11:2 = #0 // CHECK-FUNC: File 0, 6:15 -> 8:4 = #1 // CHECK-FUNC: File 0, 8:10 -> 10:4 = (#0 - #1) -// CHECK-FUNC: Expansion,File 1, 6:10 -> 6:28 = #0 (Expanded file = 0) // CHECK-STATIC-FUNC: static_func // CHECK-STATIC-FUNC: File 0, 12:32 -> 20:2 = #0 // CHECK-STATIC-FUNC: File 0, 14:15 -> 16:4 = #1 // CHECK-STATIC-FUNC: File 0, 16:10 -> 18:4 = (#0 - #1) -// CHECK-STATIC-FUNC: Expansion,File 1, 6:10 -> 6:28 = #0 (Expanded file = 0) // CHECK-STATIC-FUNC2: static_func2 // CHECK-STATIC-FUNC2: File 0, 21:33 -> 29:2 = 0 -// CHECK-STATIC-FUNC2: Expansion,File 1, 6:10 -> 6:28 = 0 (Expanded file = 0) -- cgit v1.2.3