loki.transformations.inline.procedures
Functions
|
Inline internal subroutines contained in an individual |
|
Inline |
|
Inline internal subroutines contained in an individual |
|
Inline a set of call to an individual |
|
Resolve arguments of a call and map to the called procedure body. |
Resolve sequence association in calls to all member procedures (if |
- inline_internal_procedures(routine, allowed_aliases=None)
Inline internal subroutines contained in an individual
Subroutine
.Please note that internal functions are not yet supported!
- Parameters:
routine (
Subroutine
) – The subroutine in which to inline all member routinesallowed_aliases (tuple or list of str or
Expression
, optional) – List of variables that will not be renamed in the parent scope, even if they alias with a local declaration.
- inline_member_procedures(routine, allowed_aliases=None)
Inline internal subroutines contained in an individual
Subroutine
.Please note that internal functions are not yet supported!
- Parameters:
routine (
Subroutine
) – The subroutine in which to inline all member routinesallowed_aliases (tuple or list of str or
Expression
, optional) – List of variables that will not be renamed in the parent scope, even if they alias with a local declaration.
- inline_marked_subroutines(routine, allowed_aliases=None, adjust_imports=True)
Inline
Subroutine
objects guided by pragma annotations.When encountering
CallStatement
objects that are marked with a!$loki inline
pragma, this utility will attempt to replace the call with the body of the called procedure and remap all passed arguments into the calling procedures scope.Please note that this utility requires
CallStatement
objects to be “enriched” with external type information.- Parameters:
routine (
Subroutine
) – The subroutine in which to look for pragma-marked procedures to inlineallowed_aliases (tuple or list of str or
Expression
, optional) – List of variables that will not be renamed in the parent scope, even if they alias with a local declaration.adjust_imports (bool) – Adjust imports by removing the symbol of the inlined routine or adding imports needed by the imported routine (optional, default: True)
- resolve_sequence_association_for_inlined_calls(routine, inline_internals, inline_marked)
Resolve sequence association in calls to all member procedures (if
inline_internals = True
) or in calls to procedures that have been marked with an inline pragma (ifinline_marked = True
). If bothinline_internals
andinline_marked
areFalse
, no processing is done.