Don't generate program allocations if there aren't any.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>