ecmwf-ifs / loki

Freely programmable source-to-source translation for Fortran
https://sites.ecmwf.int/docs/loki/
Apache License 2.0
29 stars 12 forks source link

Transformations: Remap declaration symbols and adjust imports when inlining #311

Closed mlange05 closed 4 months ago

mlange05 commented 5 months ago

This PR brings two fixes to the InlineTransformation:

  1. Additional symbol-remapping of hoisted declarations, so that renaming of array declaration sizes is adjusted appropriately.
  2. In addition to removing the inlined procedure symbol from the caller's imports, we now also hoist any needed imports from the inlined callee into the spec of the caller. Subsequently, I've renamed the remove_imports constructor flag to adjust_imports to toggle this behaviour.

As always, appropriate tests have been added or extended.

github-actions[bot] commented 5 months ago

Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/311/index.html

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.11%. Comparing base (5300280) to head (606cba1). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #311 +/- ## ======================================= Coverage 95.11% 95.11% ======================================= Files 165 165 Lines 35065 35116 +51 ======================================= + Hits 33351 33402 +51 Misses 1714 1714 ``` | [Flag](https://app.codecov.io/gh/ecmwf-ifs/loki/pull/311/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs) | Coverage Δ | | |---|---|---| | [lint_rules](https://app.codecov.io/gh/ecmwf-ifs/loki/pull/311/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs) | `96.39% <ø> (ø)` | | | [loki](https://app.codecov.io/gh/ecmwf-ifs/loki/pull/311/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs) | `95.09% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

reuterbal commented 4 months ago

Looks great! Merge after tests are complete