carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
http://docs.carbon-lang.dev/
Other
32.24k stars 1.48k forks source link

Add rudimentry debug info metadata emission #4225

Closed dwblaikie closed 1 month ago

dwblaikie commented 1 month ago

This adds just the debug info metadata for Compilation Units (the top level container of debug info) - but without anything in them, LLVM won't emit them at all, so while this is testable at the IR level, it isn't observable at the object level until more debug info is added.

A couple of starting points in this patch:

dwblaikie commented 1 month ago

Are you using pre-commit (pre-commit install)? I think it would've automatically fixed this by running clang-format for you.

Ah, nope - missed that, sorry. Thanks for the pointer/reminder. Think I managed to run it on some of my stuff that's already committed (with pre-commit run --all-files) to the branch - it caught one formatting error, but otherwise seems clean

chandlerc commented 1 month ago

Mostly this'll be a place to discuss the flag naming/functionality, and testing strategy. Should we have debug info on in all lowering tests? Should there be some separate directory just for debug info lowering test coverage? I'm open to ideas/suggestions/requests.

Not a comment on the patch, but maybe update the description before merging to summarize what your suggested starting point is for these questions, and what motivates that starting point?

(FWIW, not disagreeing with the current behavior, mostly looking to have a record of it.)

dwblaikie commented 1 month ago

Mostly this'll be a place to discuss the flag naming/functionality, and testing strategy. Should we have debug info on in all lowering tests? Should there be some separate directory just for debug info lowering test coverage? I'm open to ideas/suggestions/requests.

Not a comment on the patch, but maybe update the description before merging to summarize what your suggested starting point is for these questions, and what motivates that starting point?

(FWIW, not disagreeing with the current behavior, mostly looking to have a record of it.)

Updated - hopefully that's something along the lines of what you're looking for.