summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping
Commit message (Collapse)AuthorAgeFilesLines
* [PGO] make profile prefix even shorter and more readableXinliang David Li2015-12-152-5/+5
| | | | llvm-svn: 255587
* [PGO] Shorten profile symbol prefixesXinliang David Li2015-12-142-5/+5
| | | | | | | | | | (test case update) Profile symbols have long prefixes which waste space and creating pressure for linker. This patch shortens the prefixes to minimal length without losing verbosity. Differential Revision: http://reviews.llvm.org/D15503 llvm-svn: 255576
* [PGO] Stop using invalid char in instr variable names.Xinliang David Li2015-12-121-1/+1
| | | | | | | (This is part-2 of the patch of r255434 -- fixing test cases, second try) llvm-svn: 255435
* [PGO] Revert r255366: solution incomplete, not handling lambda yetXinliang David Li2015-12-111-1/+1
| | | | llvm-svn: 255368
* [PGO] Stop using invalid char in instr variable names.Xinliang David Li2015-12-111-1/+1
| | | | | | | | | | | | | | | | (This is part-2 of the patch -- fixing test cases) Before the patch, -fprofile-instr-generate compile will fail if no integrated-as is specified when the file contains any static functions (the -S output is also invalid). This patch fixed the issue. With the change, the index format version will be bumped up by 1. Backward compatibility is preserved with this change. Differential Revision: http://reviews.llvm.org/D15243 llvm-svn: 255366
* InstrProf: Fix a misuse of the FunctionDecl API when generating coverageJustin Bogner2015-07-281-0/+15
| | | | | | | | | | | This was calling FD->hasBody(), meaning "Does the function that this decl refers to have a body?", rather than FD->doesThisDeclarationHaveABody(), meaning "Is this decl a non-deleted definition?". We might want to consider renaming these APIs :/ llvm-svn: 243360
* InstrProf: Fix a typo in the test for r243066Justin Bogner2015-07-231-1/+1
| | | | llvm-svn: 243068
* InstrProf: Don't extend coverage regions into the catch keywordJustin Bogner2015-07-231-0/+24
| | | | | | | | The catch keyword isn't really part of a region, so it's fairly meaningless to extend into it. This was usually harmless, but it could crash when catch blocks involved macros in strange ways. llvm-svn: 243066
* InstrProf: Pack the coverage mapping structs that we write outJustin Bogner2015-07-021-1/+1
| | | | | | | When we read this data we treat it as unaligned and packed, so we should really be explicit about that when we write it. llvm-svn: 241218
* InstrProf: Fix a crash when an implicit def appears in a macroJustin Bogner2015-06-231-0/+16
| | | | llvm-svn: 240452
* InstrProf: Fix coverage mapping when "if" is a macroJustin Bogner2015-06-161-0/+14
| | | | | | | | | We were propagating the coverage map into the body of an if statement, but not into the condition thereafter. This is fine as long as the two locations are in the same virtual file, but they won't be when the "if" part of the statement is from a macro and the condition is not. llvm-svn: 239803
* InstrProf: Only disable coverage in built-in macros, not all system macrosJustin Bogner2015-05-141-0/+24
| | | | | | | | | The issue I was trying to solve in r236547 was about built-in macros, but I disabled coverage in all system macros. This is actually a bit of overkill, and makes the display of coverage around system macros degrade unnecessarily. Instead, limit this to builtins specifically. llvm-svn: 237397
* InstrProf: Don't start or end coverage regions inside of system macrosJustin Bogner2015-05-051-0/+12
| | | | | | | | | | | It doesn't make much sense to try to show coverage inside system macros, and source locations in builtins confuses the coverage mapping. Just avoid doing this. Fixes an assert that fired when a __block storage specifier starts a region. llvm-svn: 236547
* InstrProf: Fix a coverage crash where a macro begins in an unreachable blockJustin Bogner2015-05-011-0/+15
| | | | llvm-svn: 236335
* InstrProf: Make sure coverage propagates out of foreach loops correctlyJustin Bogner2015-04-301-4/+11
| | | | llvm-svn: 236264
* InstrProf: Mark code regions after throw expressions as unreachableJustin Bogner2015-04-281-6/+8
| | | | | | | We weren't setting regions as being unreachable after C++ throw expressions, leading to incorrect count propagations. llvm-svn: 235967
* InstrProf: Fix coverage maps for conditional operatorsJustin Bogner2015-04-241-1/+15
| | | | | | | | | This fixes a crash when we're emitting coverage and a macro appears between two binary conditional operators, ie, "foo ?: MACRO ?: bar", and fixes the interaction of macros and conditional operators in general. llvm-svn: 235793
* InstrProf: Fix a shadowing error that would break length of profile namesJustin Bogner2015-04-231-3/+3
| | | | | | | | We try to use the member variable "FuncName" here, but we've also used that name as a parameter. This ends with us getting the length of the function name wrong when we generate the coverage data. llvm-svn: 235565
* InstrProf: Handle whitespace and comments at the ends of macrosJustin Bogner2015-03-251-0/+11
| | | | | | | | | | | | | | | When we try to find the end loc for a token, we have to re-lex the token. This was running into a problem when we'd store the end loc of a macro's coverage region, since we wouldn't actually be at the beginning of a token when we tried to re-lex it, leading us to do silly things (and eventually assert) when whitespace or comments followed. This pushes our use of getPreciseTokenLocEnd earlier, so that we won't call it when it doesn't make sense to. It also removes an unnecessary adjustment by 1 that was working around this problem in some cases. llvm-svn: 233169
* Test case updates for explicit type parameter to the gep operatorDavid Blaikie2015-03-131-1/+1
| | | | llvm-svn: 232187
* InstrProf: Make sure counts in lambdas don't escape to the parent scopeJustin Bogner2015-02-241-0/+17
| | | | | | | | When generating coverage maps, we were traversing the body as if it were part of the parent function, but this doesn't make sense since we're currently counting lambdas as separate functions. llvm-svn: 230304
* InstrProf: Always emit a coverage region for the condition of an ifJustin Bogner2015-02-1915-41/+76
| | | | | | | | When tools like llvm-cov show regions, it's much easier to understand what's happening if the condition of an if shows a counter as well as the body. llvm-svn: 229813
* InstrProf: Rewrite most of coverage mapping generation in a simpler wayJustin Bogner2015-02-1825-145/+631
| | | | | | | | | | | | | | | | | | | | | | | 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
* InstrProf: Add a test for PR22531Justin Bogner2015-02-111-4/+11
| | | | | | | | This is a test for the llvm change in r228793. We need to make sure that names referred to by coverage end up in the right section, or the coverage tools won't work. llvm-svn: 228794
* InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't usedJustin Bogner2015-02-0323-244/+243
| | | | llvm-svn: 228035
* InstrProf: Avoid creating profile names for symbols in system headersJustin Bogner2015-01-221-0/+21
| | | | | | | | | | We don't emit any coverage mapping for uncovered functions that come from system headers, but we were creating a GlobalVariable with each of their names. This is wasteful since the linker will need to dead strip the unused symbols, and it can lead to issues when merging coverage with others TUs that do have coverage for those functions. llvm-svn: 226764
* InstrProf: Don't emit coverage for uninstantiated templatesJustin Bogner2014-11-181-4/+24
| | | | | | | | | | | | | We include unused functions and methods in -fcoverage-mapping so that we can differentiate between uninstrumented and unused. This can cause problems for uninstantiated templates though, since they may involve an incomplete type that can't be mangled. This shows up in things like libc++'s <unordered_map> and makes coverage unusable. Avoid the issue by skipping uninstantiated methods of a templated class. llvm-svn: 222204
* InstrProf: Avoid repeated linear searches in a hot pathJustin Bogner2014-10-014-39/+43
| | | | | | | | | | | | | | | | | | | | | | When generating coverage regions, we were doing a linear search through the existing regions in order to try to merge related ones. Most of the time this would find what it was looking for in a small number of steps and it wasn't a big deal, but in cases with many regions and few mergeable ones this leads to an absurd compile time regression. This changes the coverage mapping logic to do a single sort and then merge as we go, which is a bit simpler and about 100 times faster. I've also added FIXMEs on a couple of behaviours that seem a little suspect, while keeping them behaving as they were - I'll look into these soon. The test changes here are mostly tedious reorganization, because the ordering of regions we output has become slightly (but not completely) more consistent from the almost completely arbitrary ordering we got before. llvm-svn: 218738
* Coverage Mapping: store function's hash in coverage function records.Alex Lorenz2014-08-211-1/+1
| | | | | | | | | | The profile data format was recently updated and the new indexing api requires the code coverage tool to know the function's hash as well as the function's name to get the execution counts for a function. Differential Revision: http://reviews.llvm.org/D4995 llvm-svn: 216208
* Test: CoverageMapping: use "RUN: FileCheck" command instead of "RUN: cat | ↵Alex Lorenz2014-08-203-9/+9
| | | | | | | | | | Filecheck". Change the lit RUN commands for 3 tests to use the following pattern "FileCheck -input-file ..." instead of "cat ... | FileCheck ..." as suggested by Justin Bogner. llvm-svn: 216085
* Coverage mapping: fix mapping for objective-c for statementAlex Lorenz2014-08-201-0/+18
| | | | llvm-svn: 216082
* Coverage mapping: fix mapping for objective-c message expressionAlex Lorenz2014-08-201-0/+11
| | | | llvm-svn: 216081
* Test: Coverage Mapping: add missing RUN commandsAlex Lorenz2014-08-192-10/+10
| | | | | | | Add the llvm-lit RUN commands for the two coverage mapping tests that filecheck a temporary file. llvm-svn: 216020
* Add tests for coverage mapping generation.Alex Lorenz2014-08-1926-0/+712
| | | | | | | | | | This patch adds the tests for the coverage mapping generation. Most of the tests check the mapping regions produced by the generator, and one checks the llvm IR. Differential Revision: http://reviews.llvm.org/D4847 llvm-svn: 215995
* Revert "Add tests for coverage mapping generation."Justin Bogner2014-08-0927-1162/+0
| | | | | | | | | | | | | | | I reverted one of the added tests from r215261 in r215274, since it was failing on quite a few bots. It looks like this wasn't sufficient, as we're still getting failures on windows, like the following: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/5378 I'm reverting this entire commit so the bots aren't blocked on these failures. This reverts commit r215261. llvm-svn: 215278
* Revert a failing test from r215261Justin Bogner2014-08-091-71/+0
| | | | | | | The (new) CoverageMapping/macroparams.c test is failing on a number of buildbots. Reverting it until Alex can investigate and fix the test. llvm-svn: 215274
* Add tests for coverage mapping generation.Alex Lorenz2014-08-0828-0/+1233
This patch adds the tests for the coverage mapping generation. Most of the tests check the mapping regions produced by the generator, and one checks the llvm IR. Differential Revision: http://reviews.llvm.org/D4793 llvm-svn: 215261
OpenPOWER on IntegriCloud