Skip to content

Conversation

@abidh
Copy link
Contributor

@abidh abidh commented Nov 18, 2025

This PR uses the information generated in #168106 to generate correct debug metadata for use statement when only and => are used.

The debug flow is changed a bit where we process the module globals first so that we have the global variables when we start to process fir.use_stmt. There was another small cleanup that same ID is used in both the placeholder and the actual DISubprogramAttr.

This patch adds infrastructure to emit Fortran USE statement
information in FIR, which will be used by subsequent patches to generate
DWARF debug information.

The information about use statement is collected during semantic
analysis and stored in PreservedUseStmt objects. During
lowering, fir.use_stmt operations are emitted for each PreservedUseStmt
object. The fir.use_stmt operation captures the module name, ONLY list
symbols, and any renames specified in the USE statement.
This patch uses the fir.use_stmt operations to generate correct
debug metadata for use statement when `only` and `=>` are used.

The debug flow is changed a bit where we process the module globals
first so that we have the global variables when we start to process
fir.use_stmt. There was another small cleanup that same ID is used in
both the placeholder and the actual DISubprogramAttr.
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

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

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

🐧 Linux x64 Test Results

  • 4061 tests passed
  • 202 tests skipped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant