Skip to content

Conversation

@adam-yang
Copy link
Contributor

@adam-yang adam-yang commented Oct 4, 2025

Previously, global variables converted to alloca's, their debug info is written as a dbg.value for a fake local variable prefixed with "global.". This was only done for the entry function's DISubprogram, which makes the variable inaccessible for all inlined function scopes.

This change creates a dbg.value for each inlined DISubprogram, each pointing to a new DILocalVariable with the inlined DISubprogram as its scope.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@adam-yang adam-yang self-assigned this Oct 6, 2025
@adam-yang adam-yang marked this pull request as ready for review October 6, 2025 21:08
@adam-yang adam-yang requested a review from llvm-beanz November 13, 2025 19:15
Copy link
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

FWIW, I wasn't sure what the .ll test was testing (mostly through my ignorance), but I checked out the branch and reverted the functional changes and that test started failing, which convinced me at least that it is testing something.

I would recommend getting a review from someone more familiar with the codebase than I am!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

3 participants