summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CoverageMappingGen.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix -Wpessimizing-move by removing call to std::moveRichard Trieu2015-04-301-1/+1
| | | | llvm-svn: 236281
* InstrProf: Make sure coverage propagates out of foreach loops correctlyJustin Bogner2015-04-301-4/+8
| | | | llvm-svn: 236264
* InstrProf: Mark code regions after throw expressions as unreachableJustin Bogner2015-04-281-0/+7
| | | | | | | 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/+7
| | | | | | | | | 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
* Change range-based for-loops to be -Wrange-loop-analysis clean.Richard Trieu2015-04-151-1/+1
| | | | | | No functionality change. llvm-svn: 234964
* InstrProf: Handle whitespace and comments at the ends of macrosJustin Bogner2015-03-251-4/+4
| | | | | | | | | | | | | | | 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
* InstrProf: Make sure counts in lambdas don't escape to the parent scopeJustin Bogner2015-02-241-0/+5
| | | | | | | | 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-191-1/+4
| | | | | | | | 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-181-660/+516
| | | | | | | | | | | | | | | | | | | | | | | 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: Update for LLVM API changeJustin Bogner2015-02-031-9/+7
| | | | | | Update for the API change in r228075 llvm-svn: 228076
* InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't usedJustin Bogner2015-02-031-14/+11
| | | | llvm-svn: 228035
* InstrProf: Update for LLVM API changeJustin Bogner2015-02-031-10/+10
| | | | | | Update for the change in r227900. llvm-svn: 227901
* InstrProf: Use an Optional instead of an out parameterJustin Bogner2015-01-241-32/+27
| | | | llvm-svn: 227015
* InstrProf: Use the stream when dumping countersJustin Bogner2015-01-231-1/+1
| | | | llvm-svn: 226968
* [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.pyChandler Carruth2015-01-141-2/+2
| | | | | | | | | | Sorry for the noise, I managed to miss a bunch of recent regressions of include orderings here. This should actually sort all the includes for Clang. Again, no functionality changed, this is just a mechanical cleanup that I try to run periodically to keep the #include lines as regular as possible across the project. llvm-svn: 225979
* InstrProf: Simplify/reduce state in CoverageMapping (NFC)Justin Bogner2014-12-171-38/+2
| | | | | | | | This state object makes things harder to reason about and isn't really useful, since we can just emit the mappings before the state changes rather than holding on to it. llvm-svn: 224476
* InstrProf: Remove an unnecessary helper function (NFC)Justin Bogner2014-11-111-26/+12
| | | | | | | VisitSubStmtRBraceState is really just Visit, as long as VisitCompoundStatement handles braces correctly. llvm-svn: 221659
* Reapply "InstrProf: Update for the LLVM API change in r218879"Justin Bogner2014-10-021-6/+3
| | | | | | | | Reapplying now that r218887 is in. This reverts commit r218882, reapplying r218880. llvm-svn: 218888
* Revert "InstrProf: Update for the LLVM API change in r218879"Justin Bogner2014-10-021-3/+6
| | | | | | | | r218879 has been reverted for now, this needs to go to match. This reverts commit r218880. llvm-svn: 218882
* InstrProf: Update for the LLVM API change in r218879Justin Bogner2014-10-021-6/+3
| | | | llvm-svn: 218880
* InstrProf: Avoid repeated linear searches in a hot pathJustin Bogner2014-10-011-51/+33
| | | | | | | | | | | | | | | | | | | | | | 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
* InstrProf: Hide SourceMappingRegion's internals (NFC)Justin Bogner2014-10-011-12/+31
| | | | | | | | This struct has some members that are accessed directly and others that need accessors, but it's all just public. This is confusing, so I've changed it to a class and made more members private. llvm-svn: 218737
* InstrProf: Remove an unused member (NFC)Justin Bogner2014-09-301-6/+3
| | | | llvm-svn: 218697
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-271-2/+1
| | | | | | just letting them be implicitly created. llvm-svn: 216528
* Coverage Mapping: store function's hash in coverage function records.Alex Lorenz2014-08-211-3/+5
| | | | | | | | | | 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
* Coverage mapping: fix mapping for objective-c for statementAlex Lorenz2014-08-201-0/+1
| | | | llvm-svn: 216082
* Coverage mapping: fix mapping for objective-c message expressionAlex Lorenz2014-08-201-0/+10
| | | | llvm-svn: 216081
* Add a cc1 "dump-coverage-mapping" for testing coverage mapping.Alex Lorenz2014-08-081-2/+53
| | | | | | Differential Revision: http://reviews.llvm.org/D4799 llvm-svn: 215258
* Add coverage mapping generation.Alex Lorenz2014-08-041-0/+1166
This patch adds the '-fcoverage-mapping' option which allows clang to generate the coverage mapping information that can be used to provide code coverage analysis using the execution counts obtained from the instrumentation based profiling (-fprofile-instr-generate). llvm-svn: 214752
OpenPOWER on IntegriCloud