summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-line-if.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [FileCheck] Add -allow-deprecated-dag-overlap to failing clang testsJoel E. Denny2018-07-111-1/+1
| | | | | | | | | | See https://reviews.llvm.org/D47106 for details. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D47172 llvm-svn: 336844
* Add the loop end location to the loop metadata. This additional informationAmara Emerson2016-11-101-8/+12
| | | | | | | | | | | | can be used to improve the locations when generating remarks for loops. Depends on the companion LLVM change r286227. Patch by Florian Hahn. Differential Revision: https://reviews.llvm.org/D25764 llvm-svn: 286456
* Add a loop's debug location to its llvm.loop metadataHal Finkel2016-05-251-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Getting accurate locations for loops is important, because those locations are used by the frontend to generate optimization remarks. Currently, optimization remarks for loops often appear on the wrong line, often the first line of the loop body instead of the loop itself. This is confusing because that line might itself be another loop, or might be somewhere else completely if the body was an inlined function call. This happens because of the way we find the loop's starting location. First, we look for a preheader, and if we find one, and its terminator has a debug location, then we use that. Otherwise, we look for a location on an instruction in the loop header. The fallback heuristic is not bad, but will almost always find the beginning of the body, and not the loop statement itself. The preheader location search often fails because there's often not a preheader, and even when there is a preheader, depending on how it was formed, it sometimes carries the location of some preceeding code. I don't see any good theoretical way to fix this problem. On the other hand, this seems like a straightforward solution: Put the debug location in the loop's llvm.loop metadata. When emitting debug information, this commit causes us to add the debug location as an operand to each loop's llvm.loop metadata. Thus, we now generate this metadata for all loops (not just loops with optimization hints) when we're otherwise generating debug information. The remark test case changes depend on the companion LLVM commit r270771. llvm-svn: 270772
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-1/+1
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* DebugInfo: Metadata constructs now start with DI*Duncan P. N. Exon Smith2015-04-291-4/+4
| | | | | | | | | | LLVM r236120 renamed debug info IR constructs to use a `DI` prefix, now that the `DIDescriptor` hierarchy has been gone for about a week. This commit was generated using the rename-md-di-nodes.sh upgrade script attached to PR23080, followed by running clang-format-diff.py on the `lib/` portion of the patch. llvm-svn: 236121
* IR: Move MDLocation into place (clang testcases)Duncan P. N. Exon Smith2015-01-141-4/+4
| | | | | | Update testcases to match LLVM change in r226048. llvm-svn: 226049
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-151-4/+4
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* DebugInfo: Test that the loop backedge in a range-for is attribute to the ↵David Blaikie2014-08-221-0/+12
| | | | | | | | | | | loop header. This already works, but somewhat by accident (due to the order of emission in clang, the location is set to the loop header (during the emission of the iteratior increment) before the loop backedge is emitted), so let's just add a test for symmetry and future-proofing. llvm-svn: 216298
* DebugInfo: for loop backedge should be attributed to the start of the for ↵David Blaikie2014-08-221-0/+12
| | | | | | | | | | | | | | | | statement. Similar to r215768 (which fixed the same case for while loops). To quote r215768's commit message: "A little test case simplification - this could be simplified further, though there are certainly interesting connections to the if/else construct so I'm hesitant to remove that entirely though it does appear somewhat unrelated. (similar fix to r215766, related to PR19864)" llvm-svn: 216297
* DebugInfo: While loop backedge should be attribute to the start of the while ↵David Blaikie2014-08-151-14/+25
| | | | | | | | | | | | | statement. A little test case simplification - this could be simplified further, though there are certainly interesting connections to the if/else construct so I'm hesitant to remove that entirely though it does appear somewhat unrelated. (similar fix to r215766, related to PR19864) llvm-svn: 215768
* DebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for ↵David Blaikie2014-08-151-3/+3
| | | | | | | | | | | | | | | loop, to the start of the loop. This avoids debuggers stepping to strange places (like the last statement in the loop body, or the first statement in the if). This is not the whole answer, though - similar bugs no doubt exist in other loops (patches to follow) and attributing exception handling code to the correct line is also tricky (based on the previous fix to PR19864, exception handling is still erroneously attributed to the 'if' line). llvm-svn: 215766
* Enable -gcolumn-info by default.Diego Novillo2014-07-101-1/+1
| | | | | | | | | | | | | | | This patch flips the default value for -gcolumn-info to be on by default. I discussed the rationale and provided compile/size data in: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/074290.html This also updates the documentation and some tests that relied on the lack of column information. Some tests had column information in the expected output, but it was wrong (the tsan tests). Others were using the driver to execute. llvm-svn: 212781
* Debug Info: Fix the source range for IfStmt's ConditionScope.Adrian Prantl2014-05-281-0/+20
Since the continuation block of the if statement is emitted within the condition scope this had the undesirable effect of creating a line table entry at the end of the then or else statement, a line that may have never been executed. PR19864 / rdar://problem/17052973 llvm-svn: 209764
OpenPOWER on IntegriCloud