Added an option that allows to emit only '.loc' and '.file' kind debug
directives, but disables emission of the DWARF sections. Required for
NVPTX target to support profiling. It requires '.loc' and '.file'
directives, but does not require any DWARF sections for the profiler.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 20971 Build 20971: arc lint + arc unit
Event Timeline
Sorry, I'm a bit confused.
- I'd expect /this/ behavior (line table directives, but no debug_info, etc) to be controlled via a DICompileUnit emission kind (a value between "NoDebug" and "LineTablesOnly" as Paul mentioned).
- I'd expect the "no ', debug'" flag (which I don't see in this change? Is it missing? is it elsewhere?) to be controlled via an MCOption - because it must be global.
Now, arguably, if we have the global "no ', debug'" flag we maybe might as well use it to implement this behavior too since we don't have any other use for it? So maybe (2) invalidates (1).
I thought, that it is not very useful to have an option that, actually, controls only single target and I decided instead to add the option that just disables emission of the DWARF sections. In this case we don't need the special debug info mode, we can use this option.
I agree with Dave here. We already have some existing functionality that handles, for example, "minimal line tables" and so extending it to be "location directives only" seems like the direction we should go.
test/DebugInfo/Generic/directives-only.ll | ||
---|---|---|
5 | Wrong comment, will remove it. |
- Naming of "DebugDirectivesOnly" could maybe be improved but I can't think of anything better - can be changed later if someone comes up with a better name in post-commit review
- Probably add a helper function to DwarfCompileUnit to test if the CUNode specifies DebugDirectivesOnly ("bool DwarfCompileUnit::hasDebugDirectivesOnly()" for example) & use that everywhere, since this test is done in enough places and is a bit verbose as-is.
Not yet, need to commit at least one more patch and then will start work on the clang patch for this feature.
Could simplify this by dropping the "::const_iterator":