summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/debugify.ll
Commit message (Collapse)AuthorAgeFilesLines
* [DebugInfo] IR/Bitcode changes for DISubprogram flags.Paul Robinson2018-11-281-2/+2
| | | | | | | | | Packing the flags into one bitcode word will save effort in adding new flags in the future. Differential Revision: https://reviews.llvm.org/D54755 llvm-svn: 347806
* [Debugify] Don't treat missing dbg.values as an error (PR37942)Vedant Kumar2018-06-261-1/+1
| | | | | | | | | When checking the debug info in a module, don't treat a missing dbg.value as an error. The dbg.value may simply have been DCE'd, in which case the debugger has enough information to display the variable as <optimized out>. llvm-svn: 335647
* [Debugify] Skip dbg.value placement for EH pads, musttailVedant Kumar2018-06-031-1/+11
| | | | | | | Placing meta-instructions into EH pads breaks certain IR invariants, as does placing instructions after a musttail call. llvm-svn: 333856
* [Debugify] Set a DI version module flag for llc compatibilityVedant Kumar2018-05-241-0/+1
| | | | | | | Setting the "Debug Info Version" module flag makes it possible to pipe synthetic debug info into llc, which is useful for testing backends. llvm-svn: 333237
* [Debugify] Avoid printing unnecessary square braces, NFCVedant Kumar2018-05-241-2/+2
| | | | llvm-svn: 333236
* [Debugify] Print the output to stderrAnastasis Grammenos2018-05-171-3/+7
| | | | | | | | | | Currently debugify prints it's output to stdout, with this patch all the output generated goes to stderr. This change lets us use debugify without taking away the ability to pipe the output to other llvm tools. llvm-svn: 332642
* [Debugfiy] Print the pass name next to the resultAnastasis Grammenos2018-05-151-2/+2
| | | | | | | | CheckDebugify now prints the pass name right next to the result of the check. Differential Revision: https://reviews.llvm.org/D46908 llvm-svn: 332416
* [Debugify] Add -debugify-each for testing each pass in a pipelineVedant Kumar2018-05-151-10/+10
| | | | | | | | | | | | | | | | This adds a -debugify-each mode to opt which, when enabled, wraps each {Module,Function}Pass in a pipeline with logic to add, check, and strip synthetic debug info for testing purposes. This mode can be used to test complex pipelines for debug info bugs, or to collect statistics about the number of debug values & locations lost throughout various stages of a pipeline. Patch by Son Tuan Vu! Differential Revision: https://reviews.llvm.org/D46525 llvm-svn: 332312
* [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.Shiva Chen2018-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to set breakpoints on labels and list source code around labels, we need collect debug information for labels, i.e., label name, the function label belong, line number in the file, and the address label located. In order to keep these information in LLVM IR and to allow backend to generate debug information correctly. We create a new kind of metadata for labels, DILabel. The format of DILabel is !DILabel(scope: !1, name: "foo", file: !2, line: 3) We hope to keep debug information as much as possible even the code is optimized. So, we create a new kind of intrinsic for label metadata to avoid the metadata is eliminated with basic block. The intrinsic will keep existing if we keep it from optimized out. The format of the intrinsic is llvm.dbg.label(metadata !1) It has only one argument, that is the DILabel metadata. The intrinsic will follow the label immediately. Backend could get the label metadata through the intrinsic's parameter. We also create DIBuilder API for labels to be used by Frontend. Frontend could use createLabel() to allocate DILabel objects, and use insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR. Differential Revision: https://reviews.llvm.org/D45024 Patch by Hsiangkai Wang. llvm-svn: 331841
* [Debugify] Don't check functions which were skippedVedant Kumar2018-02-151-0/+4
| | | | | | | If no debug info was applied to a function, its debug info shouldn't be checked (it doesn't have any :). llvm-svn: 325297
* [opt] Port the debugify passes to the new pass managerVedant Kumar2018-02-151-0/+7
| | | | llvm-svn: 325294
* [Debugify] Avoid verifier failure on non-definition subprogramsVedant Kumar2018-02-131-0/+6
| | | | | | | | | | If a function doesn't have an exact definition, don't apply debugify metadata as it triggers a DIVerifier failure. The issue is that it's invalid to have DILocations inside a DISubprogram which isn't a definition ("scope points into the type hierarchy!"). llvm-svn: 325036
* [Debugify] Add a mode to opt to enable faster testingVedant Kumar2018-01-231-0/+3
| | | | | | | | | | | | | | | | | | Opt's "-enable-debugify" mode adds an instance of Debugify at the beginning of the pass pipeline, and an instance of CheckDebugify at the end. You can enable this mode with lit using: -Dopt="opt -enable-debugify". Note that running test suites in this mode will result in many failures due to strict FileCheck commands, etc. It can be more useful to look for assertion failures which arise only when Debugify is enabled, e.g to prove that we have (or do not have) test coverage for some code path with debug info present. Differential Revision: https://reviews.llvm.org/D41793 llvm-svn: 323256
* [Debugify] Add a pass to test debug info preservationVedant Kumar2017-12-081-0/+65
The Debugify pass synthesizes debug info for IR. It's paired with a CheckDebugify pass which determines how much of the original debug info is preserved. These passes make it easier to create targeted tests for debug info preservation. Here is the Debugify algorithm: NextLine = 1 for (Instruction &I : M) attach DebugLoc(NextLine++) to I NextVar = 1 for (Instruction &I : M) if (canAttachDebugValue(I)) attach dbg.value(NextVar++) to I The CheckDebugify pass expects contiguous ranges of DILocations and DILocalVariables. If it fails to find all of the expected debug info, it prints a specific error to stderr which can be FileChecked. This was discussed on llvm-dev in the thread: "Passes to add/validate synthetic debug info" Differential Revision: https://reviews.llvm.org/D40512 llvm-svn: 320202
OpenPOWER on IntegriCloud