This is an archive of the discontinued LLVM Phabricator instance.

[Metadata] Introduce call site dbg info metadata

Authored by djtodoro on Feb 11 2019, 3:04 AM.



As discussed on RFC (, this is set of patches that introduce debug information about call site and call site parameters. Since LLVM has portion of this support (dumping DWARF 5 symbols for tail calls), we generate all this information as GNU extensions for now. All of that will be restricted under an option, until we do all necessary testing and patching.

This is first patch in the set and it introduces IR level debug information about call sites and call site parameters. It follows the way of the LLVM guidelines for introducing DI metadata in the front end and carrying in through IR and MIR.

DICallSite wraps all information about call sites.
DICallSiteParam represents debug information about call site parameter. It provides backup location once primary location that is loaded into parameter forwarding register is lost, but with providing DICallSiteParam we also provide ability to look two or more frames behind in order to search for called function entry values.

Authors: @asowda, @NikolaPrica, @djtodoro, @ivanbaev

Diff Detail

Event Timeline

djtodoro created this revision.Feb 11 2019, 3:04 AM
djtodoro edited the summary of this revision. (Show Details)Feb 11 2019, 3:13 AM
djtodoro added a subscriber: NikolaPrica.
djtodoro added a project: debug-info.
djtodoro edited the summary of this revision. (Show Details)Feb 11 2019, 6:03 AM

Thanks! I'd like to have a discussion whether encoding this in IR and threading it through the compiler or performing an late MIR analysis is the better approach before reviewing the implementation in detail. We can either do this here or on llvm-dev.

@aprantl Sure, let us continue discussion on RFC thread in llvm-dev.

djtodoro abandoned this revision.Apr 15 2019, 8:06 AM