fdoc

subroutinevisible_callsrecursiveprivate

recursive subroutine visible_calls(p, id, from, seen, stamp, relation)

Add edges from from to what id calls. What cannot be shown is replaced by what it calls.

Arguments

NameTypeIntentAttributesDescription
ptype(project_t)in

the project

idintegerin

the entity whose calls to follow

fromintegerin

where the edges start

seenintegerinoutdimension(:)

when each entity was last visited

stampintegerin

a number new for each from

relationtype(adjacency_t)inout

the relation

Calls

  • visit

Source

Show the code
recursive subroutine visible_calls(p, id, from, seen, stamp, relation)
    type(project_t), intent(in) :: p                !! the project
    integer, intent(in) :: id                       !! the entity whose calls to follow
    integer, intent(in) :: from                     !! where the edges start
    integer, intent(inout) :: seen(:)               !! when each entity was last visited
    integer, intent(in) :: stamp                    !! a number new for each `from`
    type(adjacency_t), intent(inout) :: relation    !! the relation
    integer :: j

    associate (e => p%list%box(id)%e)
        if (allocated(e%call_ids)) then
            do j = 1, size(e%call_ids)
                call visit(e%call_ids(j))
            end do
        end if
        if (allocated(e%more%binding_ids)) then
            do j = 1, size(e%more%binding_ids)
                if (e%more%binding_ids(j) > 0) call visit(e%more%binding_ids(j))
            end do
        end if
    end associate

contains

    !> Handle a call to `target`.
    recursive subroutine visit(target)
        integer, intent(in) :: target   !! what is called

        if (seen(target) == stamp) return
        seen(target) = stamp
        if (p%list%box(target)%e%visible .and. .not. is_simple_binding(p, target)) then
            call connect(relation, from, target)
        else
            call visible_calls(p, target, from, seen, stamp, relation)
        end if
    end subroutine visit

end subroutine visible_calls

Graphs

Calls

Called by